Documentation of 'ec.util.Log' Java class
Log
ec.util

Class Log

  • All Implemented Interfaces:
    java.io.Serializable


    public class Log
    extends java.lang.Object
    implements java.io.Serializable
    Defines a log to which Output outputs. Logs can be restarted after a computer outage by using the information stored in the LogRestarter restarter.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      boolean appendOnRestart
      If the log writes to a file, should it append to the file on restart, or should it overwrite the file?
      static int D_STDERR
      Specifies that the log should write to stderr (System.err)
      static int D_STDOUT
      Specifies that the log should write to stdout (System.out)
      java.io.File filename
      A filename, if the writer writes to a file
      boolean isLoggingToSystemOut 
      boolean postAnnouncements
      Should the log post announcements?
      boolean repostAnnouncementsOnRestart
      Should the log repost all announcements on restart
      LogRestarter restarter
      The log's restarter
      boolean silent
      Should we write to this log at all?
      java.io.PrintWriter writer
      The log's writer
    • Constructor Summary

      Constructors 
      Constructor and Description
      Log(java.io.File _filename, boolean _postAnnouncements, boolean _appendOnRestart)
      Creates a log to a given filename; this file may or may not be appended to on restart, depending on _appendOnRestart.
      Log(java.io.File _filename, boolean _postAnnouncements, boolean _appendOnRestart, boolean gzip)
      Creates a log to a given filename; this file may or may not be appended to on restart, depending on _appendOnRestart.
      Log(int descriptor, boolean _postAnnouncements)
      Creates a log on stdout (descriptor == Log.D_STDOUT) or stderr (descriptor == Log.D_STDERR).
      Log(java.io.Writer _writer, LogRestarter _restarter, boolean _postAnnouncements, boolean _repostAnnouncementsOnRestart)
      Creates a log on a given Writer and custom LogRestarter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      Log reopen()
      Forces a file-based log to reopen, erasing its previous contents.
      Log restart()
      Restarts a log after a system restart from checkpoint.
      • Methods inherited from class java.lang.Object

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

      • silent

        public boolean silent
        Should we write to this log at all?
      • writer

        public transient java.io.PrintWriter writer
        The log's writer
      • filename

        public java.io.File filename
        A filename, if the writer writes to a file
      • postAnnouncements

        public boolean postAnnouncements
        Should the log post announcements?
      • restarter

        public LogRestarter restarter
        The log's restarter
      • repostAnnouncementsOnRestart

        public boolean repostAnnouncementsOnRestart
        Should the log repost all announcements on restart
      • appendOnRestart

        public boolean appendOnRestart
        If the log writes to a file, should it append to the file on restart, or should it overwrite the file?
      • isLoggingToSystemOut

        public boolean isLoggingToSystemOut
      • D_STDOUT

        public static final int D_STDOUT
        Specifies that the log should write to stdout (System.out)
        See Also:
        Constant Field Values
      • D_STDERR

        public static final int D_STDERR
        Specifies that the log should write to stderr (System.err)
        See Also:
        Constant Field Values
    • Constructor Detail

      • Log

        public Log(java.io.File _filename,
                   boolean _postAnnouncements,
                   boolean _appendOnRestart)
            throws java.io.IOException
        Creates a log to a given filename; this file may or may not be appended to on restart, depending on _appendOnRestart. If and only if the file is not appended to on restart, then announcements are reposted on restart.
        Throws:
        java.io.IOException
      • Log

        public Log(java.io.File _filename,
                   boolean _postAnnouncements,
                   boolean _appendOnRestart,
                   boolean gzip)
            throws java.io.IOException
        Creates a log to a given filename; this file may or may not be appended to on restart, depending on _appendOnRestart. If and only if the file is not appended to on restart, then announcements are reposted on restart. The file can be compressed with gzip, but you may not both gzip AND appendOnRestart. If gzipped, then .gz is automagically appended to the file name.
        Throws:
        java.io.IOException
      • Log

        public Log(int descriptor,
                   boolean _postAnnouncements)
        Creates a log on stdout (descriptor == Log.D_STDOUT) or stderr (descriptor == Log.D_STDERR).
      • Log

        public Log(java.io.Writer _writer,
                   LogRestarter _restarter,
                   boolean _postAnnouncements,
                   boolean _repostAnnouncementsOnRestart)
        Creates a log on a given Writer and custom LogRestarter. In general, You should not use this to write to a file. Use Log(_filename... instead.
    • Method Detail

      • restart

        public Log restart()
                    throws java.io.IOException
        Restarts a log after a system restart from checkpoint. Returns the restarted log -- note that it may not be the same log!
        Throws:
        java.io.IOException
      • reopen

        public Log reopen()
                   throws java.io.IOException
        Forces a file-based log to reopen, erasing its previous contents. non-file logs ignore this.
        Throws:
        java.io.IOException

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.