|
Simple Log 2.0.1
[grlea] |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.grlea.log.SimpleLog
Controls the configuration and formatting of a group of SimpleLogger
s.
SimpleLog
has a default instance, which is probably the only one that anyone will
ever use. If you use the default instance, you don't even really need to know anything about
SimpleLog
- just use the basic SimpleLogger
constructor
and you'll never even know nor care.
Constructor Summary | |
SimpleLog(java.util.Properties properties)
Creates a new SimpleLog configured by the given properties object. |
|
SimpleLog(java.net.URL configurationSource)
Creates a new SimpleLog configured by a properties file read from the given URL. |
Method Summary | |
static SimpleLog |
defaultInstance()
Returns the default instance of SimpleLog . |
java.text.DateFormat |
getDateFormat()
Returns this SimpleLog 's default date format. |
DebugLevel |
getDefaultLevel()
Returns this SimpleLog 's default level. |
java.io.PrintWriter |
getWriter()
Returns the print writer that is the destination for all of this SimpleLog 's
output. |
boolean |
isDefaultTracing()
Returns this SimpleLog 's default tracing flag. |
boolean |
isPipingOutputToConsole()
Returns whether this SimpleLog , when printing output to a file, will also print
the output to the console. |
void |
reloadProperties()
Reloads this SimpleLog 's configuration. |
void |
setDateFormat(java.text.DateFormat newDateFormat)
Sets this SimpleLog 's default date format. |
void |
setDefaultLevel(DebugLevel defaultLevel)
Sets this SimpleLog 's default level. |
void |
setDefaultTracing(boolean defaultTracing)
Sets this SimpleLog 's default tracing flag. |
void |
setPipingOutputToConsole(boolean pipeOutputToConsole)
Sets whether this SimpleLog , when printing output to a file, should also print
the output to the console. |
void |
setWriter(java.io.PrintWriter out)
Sets the print writer to be used as the destination for all of this SimpleLog 's
output. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleLog(java.util.Properties properties)
SimpleLog
configured by the given properties object. SimpleLog
s log to System.err by default.
properties
- a properties object containing properties that will be used to configure
the SimpleLog
.
java.lang.IllegalArgumentException
- if properties
is null
.public SimpleLog(java.net.URL configurationSource) throws java.io.IOException
SimpleLog
configured by a properties file read from the given URL.
SimpleLog
s log to System.err by default.
configurationSource
- the properties file to use to configure the SimpleLog
instance.
java.io.IOException
- if the properties file cannot be read from the given URL.Method Detail |
public void reloadProperties()
SimpleLog
's configuration.
public static SimpleLog defaultInstance()
Returns the default instance of SimpleLog
.
The default instance is either configured from a properties file found on the classpath
with the name 'simplelog.properties', or not configured at all (if the file cannot be found).
If the instance is not configured at all, it will not produce any output unless a writer
is programmatically assigned to it (see setWriter(java.io.PrintWriter)
).
SimpleLog
.public DebugLevel getDefaultLevel()
SimpleLog
's default level.
public void setDefaultLevel(DebugLevel defaultLevel)
SimpleLog
's default level.
defaultLevel
- the new default debug level
java.lang.IllegalArgumentException
- if defaultLevel is null.public boolean isDefaultTracing()
SimpleLog
's default tracing flag.
public void setDefaultTracing(boolean defaultTracing)
SimpleLog
's default tracing flag.
defaultTracing
- the new default trace value (true
for on, false
for off).public java.text.DateFormat getDateFormat()
SimpleLog
's default date format.
public void setDateFormat(java.text.DateFormat newDateFormat)
SimpleLog
's default date format. If the given value is
null
, the default date format will be used.
newDateFormat
- the new date format. May be null
.public java.io.PrintWriter getWriter()
SimpleLog
's
output.
SimpleLog
, or null
if
it doesn't have one.public void setWriter(java.io.PrintWriter out)
SimpleLog
's
output.
out
- the print to be used by this SimpleLog
, or null
if
it should not create any output.public boolean isPipingOutputToConsole()
SimpleLog
, when printing output to a file, will also print
the output to the console. This attribute has no effect when output is not going to a file.
true
if output will be piped to the console, false
if it
won't.public void setPipingOutputToConsole(boolean pipeOutputToConsole)
SimpleLog
, when printing output to a file, should also print
the output to the console. This attribute has no effect when output is not going to a file.
pipeOutputToConsole
- true
if output should be piped to the console as well
as the output file, false
if it should not.
|
Copyright (c) 2004-2006, Graham Lea. All rights reserved. |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |