public class SystemLog extends Log
Log
that provides logging to a
PrintStream destination and is intended for sending normal application
logs to System.{out, error}
Messages written to output destinations depend upon the flushing policy of the output destination. Destinations that use System.{err,out} will flush messages after every log method invocation.
This class should be sufficient for all logging tasks. However custom
loggers that subclass Log
can also be written if really desired.
Constructor and Description |
---|
SystemLog(String name)
Creates a new SystemLog with a default destination of System.err
and a default level of
Log.DEFAULT_LEVEL |
SystemLog(String name,
PrintStream out)
Creates a new SystemLog with the specified destination and a
default level of
Log.DEFAULT_LEVEL |
SystemLog(String name,
PrintStream out,
LogLevel loglevel)
Creates a new SystemLog.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the log by flushing the destination PrintStream.
|
void |
log(LogLevel level,
Object str1) |
void |
log(LogLevel level,
Object str1,
Object str2) |
void |
log(LogLevel level,
Object str1,
Object str2,
Object str3) |
void |
log(LogLevel level,
Object str1,
Object str2,
Object str3,
Object str4) |
void |
log(LogLevel level,
Object str1,
Object str2,
Object str3,
Object str4,
Object str5) |
void |
log(LogLevel level,
Object str1,
Object str2,
Object str3,
Object str4,
Object str5,
Object str6) |
void |
log(LogLevel level,
Object str1,
Object str2,
Object str3,
Object str4,
Object str5,
Object str6,
Object str7) |
void |
log(LogLevel level,
Object str1,
Object str2,
Object str3,
Object str4,
Object str5,
Object str6,
Object str7,
Object str8) |
void |
log(LogLevel level,
Object str1,
Object str2,
Object str3,
Object str4,
Object str5,
Object str6,
Object str7,
Object str8,
Object... args) |
static void |
main(String[] args) |
bug, bug, bug, bug, bug, bug, bug, bug, canLog, closeLog, debug, debug, debug, debug, debug, debug, debug, debug, error, error, error, error, error, error, error, error, get, get, get, getDebugContext, getDefault, getLevel, getLevelNames, getLog, getName, info, info, info, info, info, info, info, info, logSystemInfo, printLevelName, printMethodInfoAtLevel, printRelativeTimestamp, printTimestamp, setDefaultLevel, setDefaultLevel, setLevel, setLevel, setLevelForAll, toString, warn, warn, warn, warn, warn, warn, warn, warn
public SystemLog(String name)
Log.DEFAULT_LEVEL
name
- name of this log (any arbitrary string)public SystemLog(String name, PrintStream out)
Log.DEFAULT_LEVEL
name
- name of this log (any arbitrary string)out
- the output destinationpublic SystemLog(String name, PrintStream out, LogLevel loglevel)
Log
and a subsequent
call to Log.get(String)
with the same name will return this log.name
- name of this log (any arbitrary string)out
- the output destinationloglevel
- the logging levelpublic void close()
close()
is not called on the PrintStream
since it would make PrintStreams like System.out
unusable by other code.public void log(LogLevel level, Object str1, Object str2, Object str3, Object str4, Object str5)
public void log(LogLevel level, Object str1, Object str2, Object str3, Object str4, Object str5, Object str6)
public void log(LogLevel level, Object str1, Object str2, Object str3, Object str4, Object str5, Object str6, Object str7)
public void log(LogLevel level, Object str1, Object str2, Object str3, Object str4, Object str5, Object str6, Object str7, Object str8)
public void log(LogLevel level, Object str1, Object str2, Object str3, Object str4, Object str5, Object str6, Object str7, Object str8, Object... args)