Class LogWriter

java.lang.Object
org.jpedal.utils.LogWriter

public final class LogWriter extends Object

logs all activity. And some low level variables/methods as it is visible to all classes.

Provided for debugging and NOT officially part of the API

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final boolean
     
    static String
    filename of logfile
    static org.jpedal.utils.LogScanner
    allow user to scan log output
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    debug(String message)
    Convenience method to output a DEBUG level entry to the LogWriter
    static void
    debug(Throwable exception, String message)
    Convenience method to output an DEBUG level entry to the LogWriter
    static void
    error(String message)
    Convenience method to output an ERROR level entry to the LogWriter
    static void
    error(Throwable exception, String message)
    Convenience method to output a ERROR level entry to the LogWriter
    static void
    info(String message)
    Convenience method to output a INFO level entry to the LogWriter
    static void
    info(Throwable exception, String message)
    Convenience method to output an INFO level entry to the LogWriter
    static void
    setupLogFile(String command_line_values)
    Method to output initial message to logs and allow log messages to output to console.
    static void
    setVerbose(boolean verbose)
    Set if log entries should also be added to the console, regardless of the current log settings.
    static void
    trace(String message)
    Convenience method to output a TRACE level entry to the LogWriter
    static void
    trace(Throwable exception, String message)
    Convenience method to output an WARNING level entry to the LogWriter
    static void
    warning(String message)
    Convenience method to output a WARNING level entry to the LogWriter
    static void
    warning(Throwable exception, String message)
    Convenience method to output an WARNING level entry to the LogWriter
    static void
    writeLog(String message)
    Write the provided message as a log entry in the current log.
    static void
    writeLog(System.Logger.Level level, Throwable exception, String message)
    Construct an entry with the given level, exception, and message and write it out.
    static void
    writeLog(Throwable throwable)
    Write an entry to the current log with a level of WARNING and a message constructed from the information provided by the throwable provided.

    Methods inherited from class java.lang.Object

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

    • logScanner

      public static org.jpedal.utils.LogScanner logScanner
      allow user to scan log output
    • log_name

      public static String log_name
      filename of logfile
    • isRunningFromIDE

      public static final boolean isRunningFromIDE
  • Method Details

    • writeLog

      public static void writeLog(Throwable throwable)
      Write an entry to the current log with a level of WARNING and a message constructed from the information provided by the throwable provided.
      Parameters:
      throwable - A Throwable object used to construct a log entry
    • writeLog

      public static void writeLog(String message)
      Write the provided message as a log entry in the current log. Level will be set to Trace unless the word exception is found in the message content
      Parameters:
      message - The message to be added to the log
    • setVerbose

      public static void setVerbose(boolean verbose)
      Set if log entries should also be added to the console, regardless of the current log settings. This will add messages to the console all log messages that are not filtered with the org.jpedal.inclusiveLogFilters system property Messages filtered by the Logger Level will appear in the console.
      Parameters:
      verbose - A boolean flag to determine if messages should be displayed in the console (true) or not (false)
    • error

      public static void error(String message)
      Convenience method to output an ERROR level entry to the LogWriter
      Parameters:
      message - The message to include in the log entry
    • error

      public static void error(Throwable exception, String message)
      Convenience method to output a ERROR level entry to the LogWriter
      Parameters:
      exception - A Throwable object that will have its message added to the log entry
      message - The message to include in the log entry
    • warning

      public static void warning(String message)
      Convenience method to output a WARNING level entry to the LogWriter
      Parameters:
      message - The message to include in the log entry
    • warning

      public static void warning(Throwable exception, String message)
      Convenience method to output an WARNING level entry to the LogWriter
      Parameters:
      exception - A Throwable object that will have its message added to the log entry
      message - The message to include in the log entry
    • info

      public static void info(String message)
      Convenience method to output a INFO level entry to the LogWriter
      Parameters:
      message - The message to include in the log entry
    • info

      public static void info(Throwable exception, String message)
      Convenience method to output an INFO level entry to the LogWriter
      Parameters:
      exception - A Throwable object that will have its message added to the log entry
      message - The message to include in the log entry
    • debug

      public static void debug(String message)
      Convenience method to output a DEBUG level entry to the LogWriter
      Parameters:
      message - The message to include in the log entry
    • debug

      public static void debug(Throwable exception, String message)
      Convenience method to output an DEBUG level entry to the LogWriter
      Parameters:
      exception - A Throwable object that will have its message added to the log entry
      message - The message to include in the log entry
    • trace

      public static void trace(String message)
      Convenience method to output a TRACE level entry to the LogWriter
      Parameters:
      message - The message to include in the log entry
    • trace

      public static void trace(Throwable exception, String message)
      Convenience method to output an WARNING level entry to the LogWriter
      Parameters:
      exception - A Throwable object that will have its message added to the log entry
      message - The message to include in the log entry
    • writeLog

      public static void writeLog(System.Logger.Level level, Throwable exception, String message)
      Construct an entry with the given level, exception, and message and write it out.
      Parameters:
      level - The level to apply to this log entry
      exception - An exception if present, this may be set to null if no exception present
      message - The message to include in the log entry
    • setupLogFile

      public static void setupLogFile(String command_line_values)
      Method to output initial message to logs and allow log messages to output to console.
      Parameters:
      command_line_values - A String, if a 'v' character is present messages are output to console.