|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object PageBoxLib.Log
Logging class.
Changes:
alexis.grandemange@pagebox.net
Copyright (c) 2002-2004 Alexis Grandemange
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public License lesser.txt should be included in the distribution.
Field Summary | |
private java.io.PrintWriter |
log
Log file |
private java.lang.String |
logFile
Path of the log file |
private static java.util.HashMap |
logs
Log map Key: path of the log file Value: Log object |
(package private) boolean |
mode
True if information messages |
private java.text.SimpleDateFormat |
sdf
SimpleDateFormat used to build log entries |
private java.lang.SecurityManager |
sm
Handle to the Security Manager. |
Constructor Summary | |
private |
Log(java.lang.String logFile,
boolean mode)
Constructor. |
Method Summary | |
(package private) void |
end()
Close the log file. |
void |
erase()
Clear the trace. |
void |
error(java.lang.String src,
java.lang.String msg)
Log an error message. |
java.lang.String |
getAudit(java.lang.String arch)
Returns the audit entries specific to an archive on a PageBox. |
static Log |
getLog(java.lang.String logFile,
boolean mode)
Return a Log object from logs. |
boolean |
getMode()
Get the tracing mode. |
java.io.BufferedReader |
getReader()
Get a Reader on the log file. |
void |
info(java.lang.String src,
java.lang.String msg)
Log an information message. |
void |
setMode(boolean mode)
Set the tracing mode. |
void |
warn(java.lang.String src,
java.lang.String msg)
Log a warning message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private final java.text.SimpleDateFormat sdf
boolean mode
private java.lang.String logFile
private static java.util.HashMap logs
private java.lang.SecurityManager sm
private java.io.PrintWriter log
Constructor Detail |
private Log(java.lang.String logFile, boolean mode)
logFile
- path of the log filemode
- true if information messagesMethod Detail |
public static Log getLog(java.lang.String logFile, boolean mode)
logFile
- path of the log filemode
- true if information messagespublic java.io.BufferedReader getReader()
public final void setMode(boolean mode)
mode
- true if information messagespublic final boolean getMode()
public final void erase()
public void info(java.lang.String src, java.lang.String msg)
src
- archive / PageBoxmsg
- messagepublic void warn(java.lang.String src, java.lang.String msg)
src
- archive / PageBoxmsg
- messagepublic void error(java.lang.String src, java.lang.String msg)
src
- archive / PageBoxmsg
- messagepublic java.lang.String getAudit(java.lang.String arch)
arch
- archive name
void end()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |