|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectLocalDrinkLogger
A basic class to perform logging for the drink software. Printing to a log is more desirable because it is much faster than printing to stdout, and it is persistent.
| Field Summary | |
private String |
filename
The file that we are printing our log messages to. |
private PrintWriter |
out
The PrintWriter that is connected the file that we are actually saving the log messages to. |
| Constructor Summary | |
LocalDrinkLogger(ConfigMgr configMgr)
Reads the settings out of the configuration file and then constructs from that. |
|
LocalDrinkLogger(String logFilename)
A constructor which assumes demarcation by default. |
|
LocalDrinkLogger(String logFilename,
boolean printDemarc)
Construct the class using the provided values instead of retrieving them from the configuration. |
|
| Method Summary | |
private void |
initialize(String logFilename,
boolean printDemarc)
Initialize the LocalDrinkLogger by opening the file. |
void |
println(String message)
Prints the specified message to the log file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private String filename
private PrintWriter out
| Constructor Detail |
public LocalDrinkLogger(String logFilename,
boolean printDemarc)
logFilename - The filename of the file to print the log messages to.printDemarc - Whether or not to print the 'new session' demarcation.public LocalDrinkLogger(String logFilename)
logFilename - The filename to write the log data to.public LocalDrinkLogger(ConfigMgr configMgr)
configMgr - Where to get our runtime configuration values.| Method Detail |
private void initialize(String logFilename,
boolean printDemarc)
logFilename - The name of the file to store log messages in.printDemarc - Whether or not to print bar that demarcates the
start of a new server session. This is printed
when the server starts up.public void println(String message)
println in interface DrinkLoggerSpecmessage - The message to print to the file.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||