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
ConstructorDescriptionStructuredLogger
(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 TypeMethodDescriptionvoid
beginSection
(String name) void
beginSection
(String name, boolean defaultOpen) void
Log an exception's stack trace.void
Log an exception's stack trace, prefixed by an optional message.void
Log an exception's stack trace, prefixed by an optional message.void
Log an exception at the debug level.void
void
Log a debug message.void
Log an error message.void
Alias forwarn()
.void
generateHtml
(FileOutputStream out, Charset charset) Same as generateHtml but per blocks.int
Retrieve the cut-off level for that logger.getName()
boolean
void
void
Reserved for internal logging.void
iBreak()
void
iBreak
(int cnt) void
void
void
void
void
void
void
Log an information message.void
boolean
boolean
void
Log a string message.void
void
setEnabledLevel
(int level) Set the cut-off level for a logger.void
void
Alias forerror()
.void
Log a transient status message (STATUS).void
Log a trace message.void
Log a warning message.void
Alias 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 aStructuredLoggerHtmlGenerator
rlEnabled
- 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:ILogger
Set the cut-off level for a logger.- Specified by:
setEnabledLevel
in 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:ILogger
Retrieve the cut-off level for that logger.- Specified by:
getEnabledLevel
in interfaceILogger
- Returns:
- the level, a number between 0 and
GlobalLog.LEVEL_CATCHING
-
log
Description copied from interface:ILogger
Log a string message. -
log
-
i
Description copied from interface:ILogger
Reserved 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:ILogger
Log a trace message. -
fine
Description copied from interface:ILogger
Alias forwarn()
. Log a trace message. -
debug
Description copied from interface:ILogger
Log a debug message. -
info
Description copied from interface:ILogger
Log an information message. -
warn
Description copied from interface:ILogger
Log a warning message. -
warning
Description copied from interface:ILogger
Alias forwarn()
. Log a warning message. -
error
Description copied from interface:ILogger
Log an error message. -
severe
Description copied from interface:ILogger
Alias forerror()
. Log an error message. -
catching
Description copied from interface:ILogger
Log an exception's stack trace. -
catching
Description copied from interface:ILogger
Log an exception's stack trace, prefixed by an optional message. -
catching
Description copied from interface:ILogger
Log an exception's stack trace, prefixed by an optional message. -
catchingSilent
Description copied from interface:ILogger
Log an exception at the debug level.- Specified by:
catchingSilent
in interfaceILogger
- Parameters:
t
- the throwable
-
status
Description copied from interface:ILogger
Log 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.
-