File tree Expand file tree Collapse file tree
src/main/java/org/scijava/plugins/scripteditor/jython Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package org .scijava .plugins .scripteditor .jython ;
2+
3+ public class JythonDev
4+ {
5+ static public int SILENT = 0 ,
6+ MESSAGES = 1 ,
7+ ERRORS = 2 ;
8+
9+ /** Adjust value to see debugging information, including:
10+ * SILENT: nothing is printed at all.
11+ * MESSAGES: prints light messages indicating some internals and the kinds of errors.
12+ * ERRORS: prints everything including exceptions.
13+ */
14+ static public int debug = MESSAGES ;
15+
16+ static public final void print (Object s ) {
17+ if (debug >= MESSAGES ) System .out .println (s );
18+ }
19+
20+ static public final void printError (Throwable e ) {
21+ if (debug >= ERRORS ) e .printStackTrace ();
22+ }
23+
24+ static public final void printTrace (Object s ) {
25+ if (debug >= ERRORS ) System .out .println (s );
26+ }
27+
28+ static public final void print (Object s , Throwable e ) {
29+ if (debug >= ERRORS ) {
30+ System .out .println (s );
31+ e .printStackTrace ();
32+ } else if (debug >= MESSAGES ) {
33+ System .out .println (s .toString () + " :: " + e .getMessage ());
34+ }
35+ }
36+
37+ }
You can’t perform that action at this time.
0 commit comments