public class

StructuredLogger

extends Object
implements ILogger
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.logging.StructuredLogger

Class Overview

The structured logger can generate HTML formatted log.

Summary

Public Constructors
StructuredLogger(String name)
Create a structured logger with structured and regular logging enabled.
StructuredLogger(String name, boolean slEnabled, boolean rlEnabled)
Create a structured logger.
Public Methods
void beginSection(String name)
void beginSection(String name, boolean defaultOpen)
void catching(Throwable t)
Log an exception's stack trace.
void catching(Throwable t, String format, Object... params)
Log an exception's stack trace, prefixed by an optional message.
void catching(Throwable t, String message)
Log an exception's stack trace, prefixed by an optional message.
void catchingSilent(Throwable t)
Log an exception at the debug level.
void closeSection()
void debug(String format, Object... params)
Log a debug message.
void error(String format, Object... params)
Log an error message.
void fine(String format, Object... params)
Alias for #trace(String, Object...) warn().
void generateHtml(FileOutputStream out, Charset charset)
Same as generateHtml but per blocks.
String generateHtml()
int getEnabledLevel()
Retrieve the cut-off level for that logger.
String getName()
boolean hasStructuredContents()
void i(String format, Object... params)
Reserved for internal logging.
void i(int importance, String format, Object... params)
void iBreak(int cnt)
void iBreak()
void iH(String format, Object... params)
void iHH(String format, Object... params)
void iHHH(String format, Object... params)
void iHHHH(String format, Object... params)
void iHHHHH(String format, Object... params)
void iL(String format, Object... params)
void iSeparator()
void info(String format, Object... params)
Log an information message.
boolean isRegularLoggingEnabled()
boolean isStructuredLoggingEnabled()
void log(int importance, int level, boolean raw, String format, Object... params)
void log(int level, boolean raw, String format, Object... params)
Log a string message.
void setEnabledLevel(int level)
Set the cut-off level for a logger.
void setName(String name)
void severe(String format, Object... params)
Alias for #error(String, Object...) error().
void status(String format, Object... params)
Log a transient status message (STATUS).
void trace(String format, Object... params)
Log a trace message.
void warn(String format, Object... params)
Log a warning message.
void warning(String format, Object... params)
Alias for #warn(String, Object...) warn().
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pnfsoftware.jeb.util.logging.ILogger

Public Constructors

public StructuredLogger (String name)

Create a structured logger with structured and regular logging enabled.

Parameters
name the logger's name

public StructuredLogger (String name, boolean slEnabled, boolean rlEnabled)

Create a structured logger.

Parameters
name the logger's name
slEnabled true to enable structured logging; when logging is complete, the structured log may be dumped to HTML using a StructuredLoggerHtmlGenerator
rlEnabled true to enable regular logging (eg, to console) as well

Public Methods

public void beginSection (String name)

public void beginSection (String name, boolean defaultOpen)

public void catching (Throwable t)

Log an exception's stack trace.

Parameters
t the throwable

public void catching (Throwable t, String format, Object... params)

Log an exception's stack trace, prefixed by an optional message.

public void catching (Throwable t, String message)

Log an exception's stack trace, prefixed by an optional message.

Parameters
message optional message prefixing stack trace

public void catchingSilent (Throwable t)

Log an exception at the debug level.

Parameters
t the throwable

public void closeSection ()

public void debug (String format, Object... params)

Log a debug message.

Parameters
format format string if parameters are provided, else standard string
params parameters

public void error (String format, Object... params)

Log an error message.

Parameters
format format string if parameters are provided, else standard string
params parameters

public void fine (String format, Object... params)

Alias for #trace(String, Object...) warn(). Log a trace message.

public void generateHtml (FileOutputStream out, Charset charset)

Same as generateHtml but per blocks. To use if result is too large.

public String generateHtml ()

public int getEnabledLevel ()

Retrieve the cut-off level for that logger.

Returns

public String getName ()

public boolean hasStructuredContents ()

public void i (String format, Object... params)

Reserved for internal logging. In Release builds, calling this method does nothing.

Parameters
format format string if parameters are provided, else standard string
params parameters

public void i (int importance, String format, Object... params)

public void iBreak (int cnt)

public void iBreak ()

public void iH (String format, Object... params)

public void iHH (String format, Object... params)

public void iHHH (String format, Object... params)

public void iHHHH (String format, Object... params)

public void iHHHHH (String format, Object... params)

public void iL (String format, Object... params)

public void iSeparator ()

public void info (String format, Object... params)

Log an information message.

Parameters
format format string if parameters are provided, else standard string
params parameters

public boolean isRegularLoggingEnabled ()

public boolean isStructuredLoggingEnabled ()

public void log (int importance, int level, boolean raw, String format, Object... params)

public void log (int level, boolean raw, String format, Object... params)

Log a string message.

public void setEnabledLevel (int level)

Set the cut-off level for a logger.

Parameters
level the cut-off level: all logging calls with a level equal or above to the cut-off will be displayed

public void setName (String name)

public void severe (String format, Object... params)

Alias for #error(String, Object...) error(). Log an error message.

Parameters
format format string if parameters are provided, else standard string
params parameters

public void status (String format, Object... params)

Log a transient status message (STATUS). Status messages are not directed to the regular output destinations; instead, they are directed to the status sinks. Only the newest message is stored in the sink.

public void trace (String format, Object... params)

Log a trace message.

Parameters
format format string if parameters are provided, else standard string
params parameters

public void warn (String format, Object... params)

Log a warning message.

Parameters
format format string if parameters are provided, else standard string
params parameters

public void warning (String format, Object... params)

Alias for #warn(String, Object...) warn(). Log a warning message.