Package de.hsh.graja.util
Class Logging
- java.lang.Object
-
- de.hsh.graja.util.Logging
-
public class Logging extends Object
This class is capable of logging formatted messages to memory buffer or standard error stream
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Logging.LoggingLevel
static class
Logging.Target
-
Constructor Summary
Constructors Constructor Description Logging(String name)
Logging(String name, Logging.Target target)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addMemoryTarget()
static String
createLogMessage(Logging.LoggingLevel level, boolean includeTimestamp, String format, Object... args)
If you want to create a log message that is not directly written to the loggervoid
debug(String format, Object... args)
void
disableTimestamps()
void
dispose()
Dispose resources.void
enableTimestamps()
void
error(String format, Object... args)
String
getContent()
only allowed for target MEMORYLogging.LoggingLevel
getLoggingLevel()
String
getName()
void
info(String format, Object... args)
boolean
isLoggable(Logging.LoggingLevel loggingLevel)
void
quiet(String format, Object... args)
void
rawAppend(String s)
String
resetLogger()
only allowed for target MEMORYString
resetLogger(boolean removeMemoryTarget)
only allowed for target MEMORYvoid
separator()
static void
setLoggingLevel(Logging.LoggingLevel level)
void
warn(String format, Object... args)
-
-
-
Constructor Detail
-
Logging
public Logging(String name)
-
Logging
public Logging(String name, Logging.Target target)
-
-
Method Detail
-
setLoggingLevel
public static void setLoggingLevel(Logging.LoggingLevel level)
-
addMemoryTarget
public boolean addMemoryTarget()
-
getName
public String getName()
-
getLoggingLevel
public Logging.LoggingLevel getLoggingLevel()
-
isLoggable
public boolean isLoggable(Logging.LoggingLevel loggingLevel)
-
enableTimestamps
public void enableTimestamps()
-
disableTimestamps
public void disableTimestamps()
-
resetLogger
public String resetLogger()
only allowed for target MEMORY
-
resetLogger
public String resetLogger(boolean removeMemoryTarget)
only allowed for target MEMORY
-
getContent
public String getContent()
only allowed for target MEMORY
-
dispose
public void dispose()
Dispose resources. After calling this method this object cannot be used any longer.
-
createLogMessage
public static String createLogMessage(Logging.LoggingLevel level, boolean includeTimestamp, String format, Object... args)
If you want to create a log message that is not directly written to the logger- Parameters:
level
-includeTimestamp
-format
-args
-
-
separator
public void separator()
-
rawAppend
public void rawAppend(String s)
-
-