Class MyLoggingFacade

  • All Implemented Interfaces:
    Logable

    public class MyLoggingFacade
    extends Object
    implements Logable
    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

    • Field Detail

      • DEFAULT_LOG_LEVEL

        public static final Level DEFAULT_LOG_LEVEL
    • Constructor Detail

      • MyLoggingFacade

        public MyLoggingFacade​(Logger logger)
      • MyLoggingFacade

        public MyLoggingFacade​(String className,
                               boolean debugOn)
      • MyLoggingFacade

        public MyLoggingFacade​(String className)
    • 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 the debug(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.
        Specified by:
        isDebugOn in interface Logable
        Returns:
      • setDebugOn

        public void setDebugOn​(boolean debugOn)
        Description copied from interface: Logable
        Enable/disable debugging for this logger
        Specified by:
        setDebugOn in interface Logable
      • 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.
        Specified by:
        debug in interface Logable
        Parameters:
        x -
      • info

        public void info​(String x)
        Description copied from interface: Logable
        Write an informational message to the log
        Specified by:
        info in interface Logable
      • warn

        public void warn​(String x)
        Description copied from interface: Logable
        Write a warning to the log. This indicates a severe, but non-fatal condition exists.
        Specified by:
        warn in interface Logable
      • error

        public void error​(String x)
        Description copied from interface: Logable
        Write an error message to the log. Typically this is invoked as the last command before throwing an exception.
        Specified by:
        error in interface Logable
      • getFileName

        public String getFileName()
      • setFileName

        public void setFileName​(String fileName)