Package edu.uiuc.ncsa.security.core.util
Class MyLoggingFacade
- java.lang.Object
-
- edu.uiuc.ncsa.security.core.util.MyLoggingFacade
-
- All Implemented Interfaces:
Logable,Serializable
public class MyLoggingFacade extends Object implements Logable, Serializable
A simple front for logging. Mostly this just centralizes various useful idioms in one place.Created by Jeff Gaynor
on Nov 9, 2010 at 10:59:40 AM- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static LevelDEFAULT_LOG_LEVEL
-
Constructor Summary
Constructors Constructor Description MyLoggingFacade(String className)MyLoggingFacade(String className, boolean debugOn)MyLoggingFacade(Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebug(String x)If debug is set on, print the string with the classname and date.voiderror(String x)Write an error message to the log.voiderror(String x, Throwable t)voiderror(Throwable t)StringgetClassName()StringgetFileName()StringgetHost()LoggergetLogger()LevelgetLogLevel()booleanhasHost()voidinfo(String x)Write an informational message to the logbooleanisDebugOn()In debug mode, calls to thedebug(String)method will print out a detailed message.protected Stringmsg(String x)voidsetClassName(String className)voidsetDebugOn(boolean debugOn)Enable/disable debugging for this loggervoidsetFileName(String fileName)voidsetHost(String host)voidsetLogLevel(Level logLevel)voidwarn(String x)Write a warning to the log.voidwarn(String x, Throwable t)voidwarn(Throwable t)
-
-
-
Field Detail
-
DEFAULT_LOG_LEVEL
public static final Level DEFAULT_LOG_LEVEL
-
-
Method Detail
-
getLogLevel
public Level getLogLevel()
-
setLogLevel
public void setLogLevel(Level logLevel)
-
getHost
public String getHost()
-
setHost
public void setHost(String host)
-
hasHost
public boolean hasHost()
-
getClassName
public String getClassName()
-
setClassName
public void setClassName(String className)
-
isDebugOn
public boolean isDebugOn()
In debug mode, calls to thedebug(String)method will print out a detailed message. This allows you to turn on or off debug prints very easily. Note though that while we can control what is printed, we cannot control Java's evaluation of the string to be printed. If the string is very expensive to compute then it will still be computed, it just won't get printed.
-
setDebugOn
public void setDebugOn(boolean debugOn)
Description copied from interface:LogableEnable/disable debugging for this logger- Specified by:
setDebugOnin interfaceLogable
-
getLogger
public Logger getLogger()
-
debug
public void debug(String x)
If debug is set on, print the string with the classname and date. Otherwise, do not print debug messages. This allows you to switch debug prints on and off throughout your code via configuration.
-
info
public void info(String x)
Description copied from interface:LogableWrite an informational message to the log
-
warn
public void warn(Throwable t)
-
warn
public void warn(String x)
Description copied from interface:LogableWrite a warning to the log. This indicates a severe, but non-fatal condition exists.
-
error
public void error(Throwable t)
-
error
public void error(String x)
Description copied from interface:LogableWrite an error message to the log. Typically this is invoked as the last command before throwing an exception.
-
getFileName
public String getFileName()
-
setFileName
public void setFileName(String fileName)
-
-