LibreOffice Module xmerge (master) 1
|
This class is used for logging debug messages. More...
Static Public Member Functions | |
static boolean | isFlagSet (int f) |
Checks if flag is set. More... | |
static void | log (int flag, String msg) |
Log message based on the flag type. More... | |
static void | log (int flag, String msg, Throwable e) |
Log message based on flag type plus print out stack trace of the exception passed in. More... | |
Static Public Attributes | |
static final int | INFO = 0x0001 |
Informational messages. More... | |
static final int | ERROR = 0x0002 |
Error messages. More... | |
static final int | TRACE = 0x0004 |
Trace messages. More... | |
Private Member Functions | |
Debug () | |
Private constructor so as not to allow any instances of this class. More... | |
Static Private Member Functions | |
static void | setOutput (String str) |
Set the output to the specified argument. More... | |
static void | setOutput (OutputStream stream) |
Set the output to an OutputStream object. More... | |
static void | setOutput (Writer w) |
Set the Writer object to manage the output. More... | |
static void | setFlags (int f, boolean set) |
This method sets the levels for debugging logs. More... | |
Static Private Attributes | |
static final boolean | SET = true |
To set a flag. More... | |
static int | flags = 0 |
static PrintWriter | writer = null |
This class is used for logging debug messages.
Currently, there are three types of logging: INFO
, TRACE
& ERROR
. Use the Debug.properties
file to set or unset each type. Also use Debug.properties
to set the writer to either System.out
, System.err
, or to a file.
Definition at line 39 of file Debug.java.
|
inlineprivate |
Private constructor so as not to allow any instances of this class.
This serves as a singleton class.
Definition at line 101 of file Debug.java.
|
inlinestatic |
Checks if flag is set.
true
if info logging is on, otherwise false
. Definition at line 176 of file Debug.java.
References org.openoffice.xmerge.util.Debug.flags.
Referenced by org.openoffice.xmerge.merger.diff.IteratorLCSAlgorithm.computeDiffs(), org.openoffice.xmerge.util.Debug.log(), org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl.merge(), and org.openoffice.xmerge.converter.xml.xslt.DocumentMergerImpl.merge().
|
inlinestatic |
Log message based on the flag type.
Example 1:
Debug.log(Debug.INFO, "info string here");
This logs the message during runtime if debug.info
in the properties file is set to true.
Example 2:
Debug.log(Debug.INFO | Debug.TRACE, "info string here");
This logs the message during runtime if debug.info or debug.trace in the properties file is set to true.
flag | Log type, one of the Debug constants INFO , TRACE , ERROR or a combination of which or'ed together. |
msg | The message. |
Definition at line 205 of file Debug.java.
References org.openoffice.xmerge.util.Debug.isFlagSet(), and org.openoffice.xmerge.util.Debug.writer.
Referenced by org.openoffice.xmerge.converter.xml.StyleCatalog.add(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.addCell(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentDeserializer.addEmptyCells(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentDeserializer.addEmptyRows(), org.openoffice.xmerge.merger.merge.CharacterBaseParagraphMerge.applyDifference(), org.openoffice.xmerge.merger.diff.NodeIterator.attributesEqual(), org.openoffice.xmerge.converter.xml.StyleCatalog.callConstructor(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentDeserializer.deserialize(), org.openoffice.xmerge.merger.diff.NodeIterator.equivalent(), org.openoffice.xmerge.converter.xml.ParaStyle.getResolved(), org.openoffice.xmerge.converter.xml.sxc.CellStyle.getResolved(), org.openoffice.xmerge.converter.xml.sxc.ColumnStyle.getResolved(), org.openoffice.xmerge.converter.xml.sxc.RowStyle.getResolved(), org.openoffice.xmerge.converter.xml.TextStyle.getResolved(), org.openoffice.xmerge.converter.xml.sxc.CellStyle.handleAttribute(), org.openoffice.xmerge.converter.xml.sxc.ColumnStyle.handleAttribute(), org.openoffice.xmerge.converter.xml.sxc.RowStyle.handleAttribute(), org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute(), org.openoffice.xmerge.converter.xml.xslt.DocumentDeserializerImpl.log(), org.openoffice.xmerge.merger.diff.NodeIterator.markTree(), org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl.merge(), org.openoffice.xmerge.merger.merge.CharacterBaseParagraphMerge.merge(), org.openoffice.xmerge.converter.xml.xslt.DocumentMergerImpl.merge(), org.openoffice.xmerge.converter.xml.sxc.CellStyle.parseColorString(), org.openoffice.xmerge.converter.xml.TextStyle.parseColorString(), org.openoffice.xmerge.merger.diff.IteratorLCSAlgorithm.printDiffTable(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentDeserializer.processCells(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentDeserializer.processColumns(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentDeserializer.processNameDefinition(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentDeserializer.processTable(), org.openoffice.xmerge.converter.dom.DOMDocument.read(), org.openoffice.xmerge.converter.xml.sxc.BookSettings.readNode(), org.openoffice.xmerge.converter.xml.sxc.NameDefinition.readNode(), org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseBody(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseCell(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseNamedExpressions(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseParagraph(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseSettings(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseTable(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseTableColumn(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseTableRow(), and org.openoffice.xmerge.converter.xml.sxc.NameDefinition.writeNode().
|
inlinestatic |
Log message based on flag type plus print out stack trace of the exception passed in.
Refer to the other log method for description.
flag | Log type, one of the Debug constants INFO , TRACE , ERROR or a combination of which or'ed together. |
msg | The message. |
e | Throwable object. |
Definition at line 223 of file Debug.java.
References org.openoffice.xmerge.util.Debug.isFlagSet(), and org.openoffice.xmerge.util.Debug.writer.
|
inlinestaticprivate |
This method sets the levels for debugging logs.
Example calls:
Debug.setFlags( Debug.INFO, Debug.SET )
Debug.setFlags( Debug.TRACE, Debug.SET )
Debug.setFlags( Debug.INFO | Debug.TRACE, Debug.SET )
Debug.setFlags( Debug.ERROR, Debug.UNSET )
f | Debug flag |
set | Use Debug.SET to set, and Debug.UNSET to unset the given flag. |
Definition at line 163 of file Debug.java.
References org.openoffice.xmerge.util.Debug.flags.
|
inlinestaticprivate |
Set the output to an OutputStream
object.
stream | OutputStream object. |
Definition at line 133 of file Debug.java.
References org.openoffice.xmerge.util.Debug.setOutput(), and stream.
|
inlinestaticprivate |
Set the output to the specified argument.
This method is only used internally to prevent invalid string parameters.
str | Output specifier. |
Definition at line 112 of file Debug.java.
References org.openoffice.xmerge.util.Debug.setOutput(), System, and org.openoffice.xmerge.util.Debug.writer.
Referenced by org.openoffice.xmerge.util.Debug.setOutput().
|
inlinestaticprivate |
Set the Writer
object to manage the output.
w | Writer object to write out. |
Definition at line 142 of file Debug.java.
References w, and org.openoffice.xmerge.util.Debug.writer.
|
static |
Error messages.
Definition at line 44 of file Debug.java.
Referenced by org.openoffice.xmerge.converter.xml.StyleCatalog.add(), org.openoffice.xmerge.converter.xml.StyleCatalog.callConstructor(), org.openoffice.xmerge.merger.diff.NodeIterator.equivalent(), org.openoffice.xmerge.converter.xml.ParaStyle.getResolved(), org.openoffice.xmerge.converter.xml.sxc.CellStyle.getResolved(), org.openoffice.xmerge.converter.xml.sxc.ColumnStyle.getResolved(), org.openoffice.xmerge.converter.xml.sxc.RowStyle.getResolved(), org.openoffice.xmerge.converter.xml.TextStyle.getResolved(), org.openoffice.xmerge.converter.xml.sxc.CellStyle.handleAttribute(), org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute(), org.openoffice.xmerge.converter.xml.sxc.CellStyle.parseColorString(), org.openoffice.xmerge.converter.xml.TextStyle.parseColorString(), and org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute().
|
staticprivate |
Definition at line 51 of file Debug.java.
Referenced by org.openoffice.xmerge.util.Debug.isFlagSet(), and org.openoffice.xmerge.util.Debug.setFlags().
|
static |
Informational messages.
Definition at line 42 of file Debug.java.
Referenced by org.openoffice.xmerge.merger.merge.CharacterBaseParagraphMerge.applyDifference(), org.openoffice.xmerge.merger.diff.NodeIterator.attributesEqual(), org.openoffice.xmerge.merger.diff.IteratorLCSAlgorithm.computeDiffs(), org.openoffice.xmerge.converter.xml.sxc.CellStyle.handleAttribute(), org.openoffice.xmerge.converter.xml.sxc.ColumnStyle.handleAttribute(), org.openoffice.xmerge.converter.xml.sxc.RowStyle.handleAttribute(), org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute(), org.openoffice.xmerge.merger.diff.NodeIterator.markTree(), org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl.merge(), org.openoffice.xmerge.merger.merge.CharacterBaseParagraphMerge.merge(), org.openoffice.xmerge.converter.xml.xslt.DocumentMergerImpl.merge(), org.openoffice.xmerge.merger.diff.IteratorLCSAlgorithm.printDiffTable(), org.openoffice.xmerge.converter.dom.DOMDocument.read(), org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseCell(), and org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseParagraph().
|
staticprivate |
To set a flag.
Definition at line 49 of file Debug.java.
|
static |
Trace messages.
Definition at line 46 of file Debug.java.
Referenced by org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.addCell(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentDeserializer.addEmptyCells(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentDeserializer.addEmptyRows(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentDeserializer.deserialize(), org.openoffice.xmerge.converter.xml.xslt.DocumentDeserializerImpl.log(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentDeserializer.processCells(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentDeserializer.processColumns(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentDeserializer.processNameDefinition(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentDeserializer.processTable(), org.openoffice.xmerge.converter.xml.sxc.BookSettings.readNode(), org.openoffice.xmerge.converter.xml.sxc.NameDefinition.readNode(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseBody(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseCell(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseNamedExpressions(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseSettings(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseTable(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseTableColumn(), org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseTableRow(), and org.openoffice.xmerge.converter.xml.sxc.NameDefinition.writeNode().
|
staticprivate |
Definition at line 52 of file Debug.java.
Referenced by org.openoffice.xmerge.util.Debug.log(), and org.openoffice.xmerge.util.Debug.setOutput().