Package com.pnfsoftware.jeb.util.logging
Class StructuredLogger
java.lang.Object
com.pnfsoftware.jeb.util.logging.StructuredLogger
- All Implemented Interfaces:
ILogger
The structured logger can generate HTML formatted log.
-
Constructor Summary
ConstructorsConstructorDescriptionStructuredLogger(String name) Create a structured logger with structured and regular logging enabled.StructuredLogger(String name, boolean slEnabled, boolean rlEnabled) Create a structured logger. -
Method Summary
Modifier and TypeMethodDescriptionvoidbeginSection(String name) voidbeginSection(String name, boolean defaultOpen) voidLog an exception's stack trace.voidLog an exception's stack trace, prefixed by an optional message.voidLog an exception's stack trace, prefixed by an optional message.voidLog an exception at the debug level.voidvoidLog a debug message.voidLog an error message.voidAlias forwarn().voidgenerateHtml(FileOutputStream out, Charset charset) Same as generateHtml but per blocks.intRetrieve the cut-off level for that logger.getName()booleanvoidvoidReserved for internal logging.voidiBreak()voidiBreak(int cnt) voidvoidvoidvoidvoidvoidvoidLog an information message.voidbooleanbooleanvoidLog a string message.voidvoidsetEnabledLevel(int level) Set the cut-off level for a logger.voidvoidAlias forerror().voidLog a transient status message (STATUS).voidLog a trace message.voidLog a warning message.voidAlias forwarn().
-
Constructor Details
-
StructuredLogger
Create a structured logger with structured and regular logging enabled.- Parameters:
name- the logger's name
-
StructuredLogger
Create a structured logger.- Parameters:
name- the logger's nameslEnabled- true to enable structured logging; when logging is complete, the structured log may be dumped to HTML using aStructuredLoggerHtmlGeneratorrlEnabled- true to enable regular logging (eg, to console) as well
-
-
Method Details
-
isStructuredLoggingEnabled
public boolean isStructuredLoggingEnabled() -
isRegularLoggingEnabled
public boolean isRegularLoggingEnabled() -
hasStructuredContents
public boolean hasStructuredContents() -
beginSection
-
beginSection
-
closeSection
public void closeSection() -
generateHtml
-
generateHtml
Same as generateHtml but per blocks. To use if result is too large.- Parameters:
out-
-
getName
-
setName
-
setEnabledLevel
public void setEnabledLevel(int level) Description copied from interface:ILoggerSet the cut-off level for a logger.- Specified by:
setEnabledLevelin interfaceILogger- Parameters:
level- the cut-off level: all logging calls with a level equal or above to the cut-off will be displayed
-
getEnabledLevel
public int getEnabledLevel()Description copied from interface:ILoggerRetrieve the cut-off level for that logger.- Specified by:
getEnabledLevelin interfaceILogger- Returns:
- the level, a number between 0 and
GlobalLog.LEVEL_CATCHING
-
log
Description copied from interface:ILoggerLog a string message. -
log
-
i
Description copied from interface:ILoggerReserved for internal logging. In Release builds, calling this method does nothing. -
iH
-
iHH
-
iHHH
-
iHHHH
-
iHHHHH
-
iL
-
i
-
iBreak
public void iBreak() -
iBreak
public void iBreak(int cnt) -
iSeparator
public void iSeparator() -
trace
Description copied from interface:ILoggerLog a trace message. -
fine
Description copied from interface:ILoggerAlias forwarn(). Log a trace message. -
debug
Description copied from interface:ILoggerLog a debug message. -
info
Description copied from interface:ILoggerLog an information message. -
warn
Description copied from interface:ILoggerLog a warning message. -
warning
Description copied from interface:ILoggerAlias forwarn(). Log a warning message. -
error
Description copied from interface:ILoggerLog an error message. -
severe
Description copied from interface:ILoggerAlias forerror(). Log an error message. -
catching
Description copied from interface:ILoggerLog an exception's stack trace. -
catching
Description copied from interface:ILoggerLog an exception's stack trace, prefixed by an optional message. -
catching
Description copied from interface:ILoggerLog an exception's stack trace, prefixed by an optional message. -
catchingSilent
Description copied from interface:ILoggerLog an exception at the debug level.- Specified by:
catchingSilentin interfaceILogger- Parameters:
t- the throwable
-
status
Description copied from interface:ILoggerLog a transient status message (STATUS). Status messages are not directed to the regular output destinations; instead, they are directed to thestatus sinks. Only the newest message is stored in the sink.
-