LibreOffice Module xmerge (master) 1
Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
org.openoffice.xmerge.util.Debug Class Reference

This class is used for logging debug messages. More...

Collaboration diagram for org.openoffice.xmerge.util.Debug:
[legend]

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Debug()

org.openoffice.xmerge.util.Debug.Debug ( )
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.

Member Function Documentation

◆ isFlagSet()

static boolean org.openoffice.xmerge.util.Debug.isFlagSet ( int  f)
inlinestatic

◆ log() [1/2]

static void org.openoffice.xmerge.util.Debug.log ( int  flag,
String  msg 
)
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.

Parameters
flagLog type, one of the Debug constants INFO, TRACE, ERROR or a combination of which or'ed together.
msgThe 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().

◆ log() [2/2]

static void org.openoffice.xmerge.util.Debug.log ( int  flag,
String  msg,
Throwable  e 
)
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.

Parameters
flagLog type, one of the Debug constants INFO, TRACE, ERROR or a combination of which or'ed together.
msgThe message.
eThrowable object.

Definition at line 223 of file Debug.java.

References org.openoffice.xmerge.util.Debug.isFlagSet(), and org.openoffice.xmerge.util.Debug.writer.

◆ setFlags()

static void org.openoffice.xmerge.util.Debug.setFlags ( int  f,
boolean  set 
)
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 )
Parameters
fDebug flag
setUse 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.

◆ setOutput() [1/3]

static void org.openoffice.xmerge.util.Debug.setOutput ( OutputStream  stream)
inlinestaticprivate

Set the output to an OutputStream object.

Parameters
streamOutputStream object.

Definition at line 133 of file Debug.java.

References org.openoffice.xmerge.util.Debug.setOutput(), and stream.

◆ setOutput() [2/3]

static void org.openoffice.xmerge.util.Debug.setOutput ( String  str)
inlinestaticprivate

Set the output to the specified argument.

This method is only used internally to prevent invalid string parameters.

Parameters
strOutput 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().

◆ setOutput() [3/3]

static void org.openoffice.xmerge.util.Debug.setOutput ( Writer  w)
inlinestaticprivate

Set the Writer object to manage the output.

Parameters
wWriter object to write out.

Definition at line 142 of file Debug.java.

References w, and org.openoffice.xmerge.util.Debug.writer.

Member Data Documentation

◆ ERROR

final int org.openoffice.xmerge.util.Debug.ERROR = 0x0002
static

◆ flags

int org.openoffice.xmerge.util.Debug.flags = 0
staticprivate

◆ INFO

final int org.openoffice.xmerge.util.Debug.INFO = 0x0001
static

◆ SET

final boolean org.openoffice.xmerge.util.Debug.SET = true
staticprivate

To set a flag.

Definition at line 49 of file Debug.java.

◆ TRACE

final int org.openoffice.xmerge.util.Debug.TRACE = 0x0004
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().

◆ writer

PrintWriter org.openoffice.xmerge.util.Debug.writer = null
staticprivate

The documentation for this class was generated from the following file: