Class TestLoggerFactory

  • All Implemented Interfaces:
    LoggerFactory

    public final class TestLoggerFactory
    extends java.lang.Object
    implements LoggerFactory
    A logger factory that writes to some PrintStream.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Logger logger  
    • Constructor Summary

      Constructors 
      Constructor Description
      TestLoggerFactory()
      Creates a new logger factory that writes to System.out.
      TestLoggerFactory​(java.io.PrintStream out)
      Creates a new logger factory that writes to the specified print stream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Logger getLogger​(java.lang.String name)
      Gets a logger for a class with the specified name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        private final Logger logger
    • Constructor Detail

      • TestLoggerFactory

        public TestLoggerFactory()
        Creates a new logger factory that writes to System.out.
      • TestLoggerFactory

        public TestLoggerFactory​(java.io.PrintStream out)
        Creates a new logger factory that writes to the specified print stream.
    • Method Detail

      • getLogger

        public Logger getLogger​(java.lang.String name)
        Description copied from interface: LoggerFactory
        Gets a logger for a class with the specified name.
        Specified by:
        getLogger in interface LoggerFactory
        Parameters:
        name - The name of the class requesting a logger, must not be null.
        Returns:
        The requested logger, never null.