Interface LogInterface

All Known Implementing Classes:
ConsoleLog, GenericLog, JulLog, Log4j2Log, Slf4jLog, TextLog, UiLog

public interface LogInterface
Interface for Logging used by MCPDBWizard software. Can be implemented by customers so that MCPDBWizard software can be fully integrated with the customer's application. This interface supports 5 types of messages

debug - Can be turned off

info - Generated during the course of normal operations

warning - Something strange has happened

error - Something bad has happened but the application is still working

systemError - Something that's really bad and is never supposed to happen has happened. The application will usually stop after one of these.

Each message has two methods to call it - a simple method which has the message text as the sole parameter and a more detailed method which allows the developer to specify

isModal - whether a modal window should come up

isLogged - whether the message should be logged to a file or other persistant storage mechanism. Although present in the interface the above two features do not have to work in all implementations.

There are also a couple of housekeeping Methods that need to implemented

flush() - Flushes any log files being written to.

getCurrentLogFile() - Returns name of current log file.

See LogInterface


Copyright 2003-2026 ATB Consultancy Services Ltd (formerly Orinda Software Ltd, Dublin, Ireland)

Version:
7
Author:
[email protected]
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Constant used when formatting message strings
    static final String
    Constant for the field delimiter used in log messages
    static final String
    Default format for day component of log file names.
    static final String
    Default format for time component of log file names.
    static final String
    Constant for the time format used in log messages
    static final String
    Constant used when formatting message strings
    static final String
    Constant used when formatting message strings
    static final String
    Constant used when formatting message strings
    static final String
    Constant used when formatting message strings
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    debug(String theMessage)
    Log a debug message.
    void
    debug(String theMessage, boolean isModal, boolean isLogged)
    Log a debug message.
    void
    Turn debug messages off
    void
    Turn debug messages on
    void
    error(Exception theException)
    Log an Exception.
    void
    error(Exception theException, boolean isModal, boolean isLogged)
    Log an error message.
    void
    error(String theMessage)
    Log an error message.
    void
    error(String theMessage, boolean isModal, boolean isLogged)
    Log an error message.
    void
    If the log is buffered then flush any outstanding changes.
    Returns a string with the name of the current log.
    Returns the current Date Format
    boolean
    Get debug status
    void
    info(String theMessage)
    Log an informational message.
    void
    info(String theMessage, boolean isModal, boolean isLogged)
    Log an informational message.
    void
    setAutoFlush(boolean flushEveryMessage)
    Controls whether the class should flush the log every time it is asked to print a message.
    void
    setAutoLog(boolean logEveryMessageByDefault)
    Controls whether the class should log every message unless told not to.
    void
    syserror(Exception theException)
    Log a serious Exception.
    void
    syserror(Exception theException, boolean isModal, boolean isLogged)
    Log a serious Exception.
    void
    syserror(String theMessage)
    Log a serious error message.
    void
    syserror(String theMessage, boolean isModal, boolean isLogged)
    Log a serious error message.
    void
    warning(String theMessage)
    Log a warning message.
    void
    warning(String theMessage, boolean isModal, boolean isLogged)
    Log a warning message.
  • Field Details

  • Method Details

    • debugOn

      void debugOn()
      Turn debug messages on
    • debugOff

      void debugOff()
      Turn debug messages off
    • getDebug

      boolean getDebug()
      Get debug status
      Returns:
      true if debug messages are being printed.
    • debug

      void debug(String theMessage)
      Log a debug message. The user does not have to see it. It will always be logged.
      Parameters:
      theMessage - A string containing the message.
    • debug

      void debug(String theMessage, boolean isModal, boolean isLogged)
      Log a debug message. The user may be forced to acknowledge it. It may be logged. Debug messages are off by default.
      Parameters:
      theMessage - A string containing the message.
      isModal - true if the user must be forced to acknowlege this message. Only meaningful if a GUI is in use.
      isLogged - true if this message is to be stored somewhere.
    • info

      void info(String theMessage)
      Log an informational message. The user does not have to acknowlege it. It will not be logged.
      Parameters:
      theMessage - A string containing the message.
    • info

      void info(String theMessage, boolean isModal, boolean isLogged)
      Log an informational message. The user may be forced to acknowledge it. It may be logged.
      Parameters:
      theMessage - A string containing the message.
      isModal - true if the user must be forced to acknowlege this message. Only meaningful if a GUI is in use.
      isLogged - true if this message is to be stored somewhere.
    • warning

      void warning(String theMessage)
      Log a warning message. The user does not have to acknowlege it. It will not be logged.
      Parameters:
      theMessage - A string containing the message.
    • warning

      void warning(String theMessage, boolean isModal, boolean isLogged)
      Log a warning message. The user may be forced to acknowledge it. It may be logged.
      Parameters:
      theMessage - A string containing the message.
      isModal - true if the user must be forced to acknowlege this message. Only meaningful if a GUI is in use.
      isLogged - true if this message is to be stored somewhere.
    • error

      void error(String theMessage)
      Log an error message. The user does not have to acknowlege it. It will not be logged.
      Parameters:
      theMessage - A string containing the message.
    • error

      void error(String theMessage, boolean isModal, boolean isLogged)
      Log an error message. The user may be forced to acknowledge it. It may be logged.
      Parameters:
      theMessage - A string containing the message.
      isModal - true if the user must be forced to acknowlege this message. Only meaningful if a GUI is in use.
      isLogged - true if this message is to be stored somewhere.
    • error

      void error(Exception theException)
      Log an Exception. The user does not have to acknowlege it. It will not be logged.
      Parameters:
      theException - A string containing the message.
    • error

      void error(Exception theException, boolean isModal, boolean isLogged)
      Log an error message. The user may be forced to acknowledge it. It may be logged.
      Parameters:
      theException - A string containing the message.
      isModal - true if the user must be forced to acknowlege this message. Only meaningful if a GUI is in use.
      isLogged - true if this message is to be stored somewhere.
    • syserror

      void syserror(String theMessage)
      Log a serious error message. The user does not have to acknowlege it. It will not be logged.
      Parameters:
      theMessage - A string containing the message.
    • syserror

      void syserror(String theMessage, boolean isModal, boolean isLogged)
      Log a serious error message. The user may be forced to acknowledge it. It may be logged.
      Parameters:
      theMessage - A string containing the message.
      isModal - true if the user must be forced to acknowlege this message. Only meaningful if a GUI is in use.
      isLogged - true if this message is to be stored somewhere.
    • syserror

      void syserror(Exception theException)
      Log a serious Exception. The user does not have to acknowlege it. It will not be logged.
      Parameters:
      theException - A string containing the message.
    • syserror

      void syserror(Exception theException, boolean isModal, boolean isLogged)
      Log a serious Exception. The user may be forced to acknowledge it. It may be logged.
      Parameters:
      theException - A string containing the message.
      isModal - true if the user must be forced to acknowlege this message. Only meaningful if a GUI is in use.
      isLogged - true if this message is to be stored somewhere.
    • setAutoFlush

      void setAutoFlush(boolean flushEveryMessage)
      Controls whether the class should flush the log every time it is asked to print a message. Slower but more reliable.
      Parameters:
      flushEveryMessage - true if the log is to be flushed every time a message is written to it.
    • flush

      void flush()
      If the log is buffered then flush any outstanding changes. If the log is not buffered do nothing.
    • getCurrentLog

      String getCurrentLog()
      Returns a string with the name of the current log.
      Returns:
      A full path name if a conventional log file is in use, or a descriptive string if no log file is in use.
    • setAutoLog

      void setAutoLog(boolean logEveryMessageByDefault)
      Controls whether the class should log every message unless told not to.
      Parameters:
      logEveryMessageByDefault - true if messages are to be logged by default.
    • getDateFormat

      String getDateFormat()
      Returns the current Date Format
      Returns:
      The Date format