public abstract class OLogger
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
OLogger.Empty
An empty logging output.
|
static class |
OLogger.File
A logging output to a text file.
|
static class |
OLogger.System
A logging output to System.out.
|
| Modifier and Type | Field and Description |
|---|---|
static char |
CR |
static java.lang.String |
DOUBLEINDENT |
static java.lang.String |
INDENT |
static char |
LF |
static java.lang.String |
NEWLINE |
static char |
SPACE |
static char |
TAB |
| Constructor and Description |
|---|
OLogger() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isEnabled()
Returns whether output is enabled.
|
boolean |
isIncludeTime()
Returns whether the timestamp "yyyy-MM-dd'@'HH:mm:ss" is prepended to each output.
|
int |
maxWrites()
Returns the limit on number of writes.
|
OLogger |
nextLogger()
Returns the next logger in the chain of loggers.
|
java.lang.String |
prefix()
Returns the prefix added to each output.
|
void |
setEnabled(boolean enabled)
Sets whether output is enabled.
|
void |
setIncludeTime(boolean includeTime)
Sets whether each write is prefixed with the timestamp.
|
void |
setMaxWrites(int maxWrites)
Sets the limit on number of writes.
|
void |
setNext(OLogger next)
Sets the next logger in the chain.
|
void |
setPrefix(java.lang.String prefix)
Sets the prefix prepended to each write.
|
void |
writeln(java.lang.String msg,
boolean error)
Writes a message, terminated with linefeed, optionally adding an error indicator.
|
public static final char SPACE
public static final char TAB
public static final char CR
public static final char LF
public static final java.lang.String INDENT
public static final java.lang.String DOUBLEINDENT
public static final java.lang.String NEWLINE
public boolean isEnabled()
public boolean isIncludeTime()
public java.lang.String prefix()
public OLogger nextLogger()
public int maxWrites()
public void setEnabled(boolean enabled)
enabled - whether output enabledpublic void setIncludeTime(boolean includeTime)
includeTime - whether timestamp addedpublic void setPrefix(java.lang.String prefix)
prefix - the prefixpublic void setNext(OLogger next)
next - the next loggerpublic void setMaxWrites(int maxWrites)
maxWrites - the write limitpublic void writeln(java.lang.String msg,
boolean error)
msg - the messageerror - whether is an error