Class LogBasedFileLog

  • All Implemented Interfaces:
    java.lang.AutoCloseable, SingleStreamLogger

    public final class LogBasedFileLog
    extends java.lang.Object
    implements SingleStreamLogger
    This class writes log information to file.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.logging.FileHandler fh  
      private java.util.logging.Logger impl  
    • Constructor Summary

      Constructors 
      Constructor Description
      LogBasedFileLog​(java.lang.String fileName, boolean append)  
      LogBasedFileLog​(java.lang.String loggerName, java.lang.String fileName, boolean append)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void log​(java.lang.String s)
      Log the String to file.
      • Methods inherited from class java.lang.Object

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

      • impl

        private final java.util.logging.Logger impl
      • fh

        private final java.util.logging.FileHandler fh
    • Constructor Detail

      • LogBasedFileLog

        public LogBasedFileLog​(java.lang.String fileName,
                               boolean append)
      • LogBasedFileLog

        public LogBasedFileLog​(java.lang.String loggerName,
                               java.lang.String fileName,
                               boolean append)
    • Method Detail

      • log

        public void log​(java.lang.String s)
        Log the String to file.
        Specified by:
        log in interface SingleStreamLogger
        Parameters:
        s - Exception that was thrown.
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface SingleStreamLogger