Skip to content

Commit

Permalink
Quiet dev diagnostic logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
gbr committed Mar 31, 2023
1 parent 4720de2 commit 066ebb3
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 30 deletions.
2 changes: 1 addition & 1 deletion net.certiv.tools.indentguide.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="net.certiv.tools.indentguide.feature"
label="IndentGuide"
version="2.2.4.qualifier"
version="2.2.5.qualifier"
provider-name="Certiv Analytis">

<description>
Expand Down
2 changes: 1 addition & 1 deletion net.certiv.tools.indentguide.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>net.certiv</groupId>
<artifactId>net.certiv.tools.indentguide.parent</artifactId>
<version>2.2.4-SNAPSHOT</version>
<version>2.2.5-SNAPSHOT</version>
</parent>

<artifactId>net.certiv.tools.indentguide.feature</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: tychotest.test
Bundle-Vendor: tychotest
Bundle-SymbolicName: net.certiv.tools.indentguide.plugin.test
Bundle-Version: 2.2.4.qualifier
Bundle-Version: 2.2.5.qualifier
Fragment-Host: net.certiv.tools.indentguide;bundle-version="2.1.0.qualifier"
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: junit-jupiter-api
Expand Down
2 changes: 1 addition & 1 deletion net.certiv.tools.indentguide.plugin.test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>net.certiv</groupId>
<artifactId>net.certiv.tools.indentguide.parent</artifactId>
<version>2.2.4-SNAPSHOT</version>
<version>2.2.5-SNAPSHOT</version>
</parent>

<artifactId>net.certiv.tools.indentguide.plugin.test</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion net.certiv.tools.indentguide.plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: IndentGuide
Bundle-SymbolicName: net.certiv.tools.indentguide;singleton:=true
Bundle-Version: 2.2.4.qualifier
Bundle-Version: 2.2.5.qualifier
Bundle-Activator: net.certiv.tools.indentguide.Activator
Bundle-Vendor: Certiv Analytics
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.24.100,4.0.0)",
Expand Down
2 changes: 1 addition & 1 deletion net.certiv.tools.indentguide.plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>net.certiv</groupId>
<artifactId>net.certiv.tools.indentguide.parent</artifactId>
<version>2.2.4-SNAPSHOT</version>
<version>2.2.5-SNAPSHOT</version>
</parent>

<artifactId>net.certiv.tools.indentguide</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ private IContentType typeOf(AbstractTextEditor editor) {
IDocumentProvider provider = editor.getDocumentProvider();
if (provider instanceof IDocumentProviderExtension4) {
try {
IContentType type = ((IDocumentProviderExtension4) provider).getContentType(editor.getEditorInput());
IContentType type = ((IDocumentProviderExtension4) provider)
.getContentType(editor.getEditorInput());
if (type != null) return type;
} catch (CoreException e) {
Activator.log(e);
Expand Down Expand Up @@ -245,7 +246,7 @@ public void partOpened(IWorkbenchPartReference ref) {
IWorkbenchPart part = ref.getPart(false);
if (part instanceof MultiPageEditorPart || part instanceof AbstractTextEditor) {
installPainter(part);
Activator.log("part opened '%s'", Utils.nameOf(part));
// Activator.log("part opened '%s'", Utils.nameOf(part));
}
}

Expand All @@ -254,15 +255,16 @@ public void partClosed(IWorkbenchPartReference ref) {
IWorkbenchPart part = ref.getPart(false);
if (part instanceof MultiPageEditorPart || part instanceof AbstractTextEditor) {
deactivate(part);
Activator.log("part closed '%s'", Utils.nameOf(part));
// Activator.log("part closed '%s'", Utils.nameOf(part));
}
}

@Override
public void pageChanged(PageChangedEvent evt) {
IPageChangeProvider provider = evt.getPageChangeProvider();
if (provider instanceof MultiPageEditorPart) {
Activator.log("MultiPageEditor page change '%s'", Utils.nameOf(provider));
// Activator.log("MultiPageEditor page change '%s'",
// Utils.nameOf(provider));
installPainter((IWorkbenchPart) provider);
}
}
Expand All @@ -277,12 +279,12 @@ public void propertyChange(PropertyChangeEvent evt) {
Object now = evt.getNewValue();

if (prop.equals(IThemeManager.CHANGE_CURRENT_THEME)) {
Activator.log("theme change '%s' [%s] => [%s]", prop, old, now);
// Activator.log("theme change '%s' [%s] => [%s]", prop, old, now);
refreshAll();

} else if (prop.startsWith(Pref.KEY)) {
if (prop.equals(Pref.ENABLED)) {
Activator.log("status change '%s' [%s] => [%s]", prop, old, now);
// Activator.log("status change '%s' [%s] => [%s]", prop, old, now);
if ((boolean) now) {
initWorkbenchWindows();

Expand All @@ -294,7 +296,8 @@ public void propertyChange(PropertyChangeEvent evt) {
updateContentTypes();

// Note: logic is reversed because it is an exclusion list
Delta<String> delta = Delta.of(Utils.undelimit((String) now), Utils.undelimit((String) old));
Delta<String> delta = Delta.of(Utils.undelimit((String) now),
Utils.undelimit((String) old));
if (delta.changed()) {
MsgBuilder mb = new MsgBuilder("content type change [%s]", prop);

Expand All @@ -311,8 +314,8 @@ public void propertyChange(PropertyChangeEvent evt) {
Activator.log(mb.toString());
}

} else {
Activator.log("property change '%s' [%s] => [%s]", prop, old, now);
// } else {
// Activator.log("property change '%s' [%s] => [%s]", prop, old, now);
}

refreshAll();
Expand All @@ -326,19 +329,19 @@ private class Data {
IContentType type;
ISourceViewer viewer;
GuidePainter painter;

Data(IWorkbenchPart part, AbstractTextEditor editor, IContentType type, ISourceViewer viewer) {
this.part = part;
this.editor = editor;
this.type = type;
this.viewer = viewer;
}

@Override
public int hashCode() {
return Objects.hash(part, editor);
}

@Override
public boolean equals(Object obj) {
if (this == obj) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import net.certiv.tools.indentguide.Activator;
import net.certiv.tools.indentguide.preferences.Pref;
import net.certiv.tools.indentguide.util.MsgBuilder;
import net.certiv.tools.indentguide.util.Utils;

/**
Expand Down Expand Up @@ -180,7 +179,7 @@ private void drawLineRange(GC gc, int begLine, int endLine, int x, int w) {
currLn.stops.clear();
currLn.stops.addAll(prevNb.stops);

log(currLn.delta, prevNb, currLn, nextNb);
// log(currLn.delta, prevNb, currLn, nextNb);

// adjust stops dependent on delta
if (currLn.delta < 0 && currLn.tabs() > 1) {
Expand Down Expand Up @@ -329,12 +328,12 @@ private void disposeLineColor() {
@Override
public void setPositionManager(IPaintPositionManager manager) {}

void log(int delta, Line prevNb, Line currLn, Line nextNb) {
Activator.log(new MsgBuilder() //
.nl().append("Delta: %s", delta) //
.nl().append("PrevNb: %s", prevNb) //
.nl().append("CurrLn: %s", currLn) //
.nl().append("NextNb: %s", nextNb)) //
;
}
// void log(int delta, Line prevNb, Line currLn, Line nextNb) {
// Activator.log(new MsgBuilder() //
// .nl().append("Delta: %s", delta) //
// .nl().append("PrevNb: %s", prevNb) //
// .nl().append("CurrLn: %s", currLn) //
// .nl().append("NextNb: %s", nextNb)) //
// ;
// }
}
2 changes: 1 addition & 1 deletion net.certiv.tools.indentguide.site/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>net.certiv</groupId>
<artifactId>net.certiv.tools.indentguide.parent</artifactId>
<version>2.2.4-SNAPSHOT</version>
<version>2.2.5-SNAPSHOT</version>
</parent>

<artifactId>net.certiv.tools.indentguide.site</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>net.certiv</groupId>
<artifactId>net.certiv.tools.indentguide.parent</artifactId>
<version>2.2.4-SNAPSHOT</version>
<version>2.2.5-SNAPSHOT</version>

<name>IndentGuide</name>
<description>IndentGuide</description>
Expand Down

0 comments on commit 066ebb3

Please sign in to comment.