|
Evaluating Software Design Patterns — the "Gang of Four" patterns implemented in Java 6 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.rode.thesis.meta.log.AbstractLog dk.rode.thesis.meta.log.AppendableLog dk.rode.thesis.meta.log.FileLog
public class FileLog
A file log logs to a given file based on the class a given log is associated with, if any, or to the default log represented by a single physical log file.
The names of log files includes "todays" date. All logs are placed
in the log
directory.
Constructor Summary | |
---|---|
FileLog(boolean append,
Class<?> clazz,
AtomicInteger lineNumber)
Constructor, which creates this log as active. |
Method Summary | |
---|---|
private static Appendable |
create(boolean append,
Class<?> clazz)
Creates a new physical log file to use for this logger. |
Methods inherited from class dk.rode.thesis.meta.log.AppendableLog |
---|
finalize, log |
Methods inherited from class dk.rode.thesis.meta.log.AbstractLog |
---|
error, format, getLineNumber, getPrefix, getPrefix, heading, isActive, print, print, println, println, setActive, toString, warn |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface dk.rode.thesis.meta.log.Log |
---|
error, getLineNumber, getPrefix, heading, isActive, print, print, println, println, setActive, warn |
Constructor Detail |
---|
FileLog(boolean append, Class<?> clazz, AtomicInteger lineNumber) throws Exception
The log will log line numbers if lineNumber
is not null.
All logs are placed in the log
directory.
append
- True to append to an existing log, false to truncate.clazz
- The class this log is associated with, if any;
can be null.lineNumber
- Line number values; can be null.
NullPointerException
- If directory
is null.
Exception
- If the creation of the file log fails.AbstractLog.isActive()
Method Detail |
---|
private static final Appendable create(boolean append, Class<?> clazz) throws Exception
The name of the log file is based on the
prefix
used
(based on clazz
) and "todays" date,
such as main.2007-08-30.log
, for example.
All logs are placed in the log
directory.
append
- True to append to an existing log, false to truncate.clazz
- The class the logger is associated with, if any; can
be null.
Exception
- If the creation fails.
|
Gunni Rode / rode.dk | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |