Package Utils
Class Log
- java.lang.Object
-
- Utils.Log
-
public class Log extends java.lang.Object
Very simple logger. Could not find a simple enough existing one!
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Log.Level
Represents different levels of message output.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
brief(java.lang.String message)
Log a new brief messagestatic void
critical(java.lang.String message)
Log a new critical messagestatic void
debug(java.lang.String message)
Log a new debug messagestatic void
detail(java.lang.String message)
Log a new detail messagestatic org.apache.commons.configuration2.tree.ImmutableNode
getConfig(Log.Level level, java.io.File log)
Get the config for a callerstatic void
initialise(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> params)
Initialise from a configurationstatic void
initialise(Log.Level level)
Initialise a logger (logs to screen)static void
initialise(Log.Level level, java.io.File f)
Initialise a logger (logs to file)static void
log(Log.Level level, java.lang.String message)
Log a new message
-
-
-
Method Detail
-
log
public static void log(Log.Level level, java.lang.String message)
Log a new message- Parameters:
level
- The level of the messagemessage
- The message
-
critical
public static void critical(java.lang.String message)
Log a new critical message- Parameters:
message
- The message
-
brief
public static void brief(java.lang.String message)
Log a new brief message- Parameters:
message
- The message
-
detail
public static void detail(java.lang.String message)
Log a new detail message- Parameters:
message
- The message
-
debug
public static void debug(java.lang.String message)
Log a new debug message- Parameters:
message
- The message
-
initialise
public static void initialise(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> params) throws OutputException
Initialise from a configuration- Parameters:
params
- Configuration- Throws:
OutputException
- If there's a problem setting up the logger
-
initialise
public static void initialise(Log.Level level)
Initialise a logger (logs to screen)- Parameters:
level
- Level to log
-
initialise
public static void initialise(Log.Level level, java.io.File f) throws java.io.IOException
Initialise a logger (logs to file)- Parameters:
level
- Level to logf
- File to log to- Throws:
java.io.IOException
- If there is a problem setting up the logger
-
getConfig
public static org.apache.commons.configuration2.tree.ImmutableNode getConfig(Log.Level level, java.io.File log)
Get the config for a caller- Parameters:
level
- The level to loglog
- The file to log to. Null logs nothing.- Returns:
- The config
-
-