Package org.deepjava.runtime.mpc555
Class Logger
- java.lang.Object
- 
- org.deepjava.runtime.mpc555.Logger
 
- 
 public class Logger extends Object Logger utility to write log messages to aPrintStream. It is possible to set six different log levels.
- 
- 
Field SummaryFields Modifier and Type Field Description static intconfigIndicates a system configuration message.static intdebugIndicates a debug message.static interrorIndicates a error message.static intinfoIndicates a information message.static intnoneIf the log level is none no message will be logged.static intwarningIndicates a warning message.
 - 
Constructor SummaryConstructors Constructor Description Logger(PrintStream stream)Creates a new Logger object which write log messages to thePrintStreamstream.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetLevel()Returns the actual level of the logger.voidlog(int level, String msg)Writes a log message to thePrintStreamif the parameterlevelis greater than the logger level.
 With % it is possible to add some arguments to the message.voidlog(int level, String msg, int val)Writes a log message to thePrintStreamif the parameterlevelis greater than the logger level.
 With % it is possible to add some arguments to the message.voidlog(int level, String msg, int... values)Writes a log message to thePrintStreamif the parameterlevelis greater than the logger level.
 With % it is possible to add some arguments to the message.voidsetLevel(int level)Set the log level.
 
- 
- 
- 
Field Detail- 
nonepublic static final int none If the log level is none no message will be logged. Don't use this level to indicate a message by alogmethod call, because this level is only used to disable all messages.- See Also:
- Constant Field Values
 
 - 
errorpublic static final int error Indicates a error message.- See Also:
- Constant Field Values
 
 - 
warningpublic static final int warning Indicates a warning message.- See Also:
- Constant Field Values
 
 - 
configpublic static final int config Indicates a system configuration message.- See Also:
- Constant Field Values
 
 - 
infopublic static final int info Indicates a information message.- See Also:
- Constant Field Values
 
 - 
debugpublic static final int debug Indicates a debug message.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
Loggerpublic Logger(PrintStream stream) Creates a new Logger object which write log messages to thePrintStreamstream. The standard log level iswarning.- Parameters:
- stream- The output stream of the logger.
 
 
- 
 - 
Method Detail- 
setLevelpublic void setLevel(int level) - Parameters:
- level- the level of the logger.
 
 - 
getLevelpublic int getLevel() Returns the actual level of the logger.- Returns:
- the actual level.
 
 - 
logpublic void log(int level, String msg)Writes a log message to thePrintStreamif the parameterlevelis greater than the logger level.
 With % it is possible to add some arguments to the message.- %t adds the actual date and time to the message
- %l adds the level description to the message
 
 log(Logger.error,"%l My log message %t",12);will log following message.
 [Erro] My log message 12.11.2009 08:57:13.- Parameters:
- level- the log level of the message.
- msg- the message.- %d.
 
 - 
logpublic void log(int level, String msg, int val)Writes a log message to thePrintStreamif the parameterlevelis greater than the logger level.
 With % it is possible to add some arguments to the message.- %t adds the actual date and time to the message
- %l adds the level description to the message
- %d adds the parameter valto the message
 
 log(Logger.error,"%l My log message with parameter value: %d",12);will log following message.
 [Erro] My log message with parameter value: 12.- Parameters:
- level- the log level of the message.
- msg- the message.
- val- an integer value which can be added to the message with- %d.
 
 - 
logpublic void log(int level, String msg, int... values)Writes a log message to thePrintStreamif the parameterlevelis greater than the logger level.
 With % it is possible to add some arguments to the message.- %t adds the actual date and time to the message
- %l adds the level description to the message
- %d adds the parameters valuesto the message
 
 log(Logger.error,"%l My log message with parameter values: %d, %d, %d,",12,13,14);will log following message.
 [Erro] My log message with parameter value: 12, 13, 14.- Parameters:
- level- the log level of the message.
- msg- the message.
- values- n integer values which can be added to the message with- %d.
 
 
- 
 
-