com.orindasoft.pub
Interface LogInterface

All Known Implementing Classes:
ConsoleLog, GenericLog, TextLog, UiLog, Log4JLog, JavaLog

public interface LogInterface

Interface for Logging used by OrindaSoft software. Can be implemented by customers so that OrindaSoft 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


(c) 2003-2011 Orinda Software Ltd

Version:
6.0
Author:
Orinda Software

Field Summary
static java.lang.String DEBUG
          Constant used when formatting message strings
static java.lang.String DEFAULT_FIELD_DELIMITER
          Constant for the field delimiter used in log messages
static java.lang.String DEFAULT_FILENAME_DAY_FORMAT
          Default format for day component of log file names.
static java.lang.String DEFAULT_FILENAME_TIME_FORMAT
          Default format for time component of log file names.
static java.lang.String DEFAULT_TIME_FORMAT_STRING
          Constant for the time format used in log messages
static java.lang.String ERROR
          Constant used when formatting message strings
static java.lang.String INFO
          Constant used when formatting message strings
static java.lang.String SYSERR
          Constant used when formatting message strings
static java.lang.String WARN
          Constant used when formatting message strings
 
Method Summary
 void debug(java.lang.String theMessage)
          Log a debug message.
 void debug(java.lang.String theMessage, boolean isModal, boolean isLogged)
          Log a debug message.
 void debugOff()
          Turn debug messages off
 void debugOn()
          Turn debug messages on
 void error(java.lang.Exception theException)
          Log an Exception.
 void error(java.lang.Exception theException, boolean isModal, boolean isLogged)
          Log an error message.
 void error(java.lang.String theMessage)
          Log an error message.
 void error(java.lang.String theMessage, boolean isModal, boolean isLogged)
          Log an error message.
 void flush()
          If the log is buffered then flush any outstanding changes.
 java.lang.String getCurrentLog()
          Returns a string with the name of the current log.
 java.lang.String getDateFormat()
          Returns the current Date Format
 boolean getDebug()
          Get debug status
 void info(java.lang.String theMessage)
          Log an informational message.
 void info(java.lang.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(java.lang.Exception theException)
          Log a serious Exception.
 void syserror(java.lang.Exception theException, boolean isModal, boolean isLogged)
          Log a serious Exception.
 void syserror(java.lang.String theMessage)
          Log a serious error message.
 void syserror(java.lang.String theMessage, boolean isModal, boolean isLogged)
          Log a serious error message.
 void warning(java.lang.String theMessage)
          Log a warning message.
 void warning(java.lang.String theMessage, boolean isModal, boolean isLogged)
          Log a warning message.
 

Field Detail

DEBUG

public static final java.lang.String DEBUG
Constant used when formatting message strings

INFO

public static final java.lang.String INFO
Constant used when formatting message strings

WARN

public static final java.lang.String WARN
Constant used when formatting message strings

ERROR

public static final java.lang.String ERROR
Constant used when formatting message strings

SYSERR

public static final java.lang.String SYSERR
Constant used when formatting message strings

DEFAULT_TIME_FORMAT_STRING

public static final java.lang.String DEFAULT_TIME_FORMAT_STRING
Constant for the time format used in log messages

DEFAULT_FILENAME_DAY_FORMAT

public static final java.lang.String DEFAULT_FILENAME_DAY_FORMAT
Default format for day component of log file names.

DEFAULT_FILENAME_TIME_FORMAT

public static final java.lang.String DEFAULT_FILENAME_TIME_FORMAT
Default format for time component of log file names.

DEFAULT_FIELD_DELIMITER

public static final java.lang.String DEFAULT_FIELD_DELIMITER
Constant for the field delimiter used in log messages
Method Detail

debugOn

public void debugOn()
Turn debug messages on

debugOff

public void debugOff()
Turn debug messages off

getDebug

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

debug

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

debug

public void debug(java.lang.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:
String - theMessage A string containing the message.
boolean - isModal true if the user must be forced to acknowlege this message. Only meaningful if a GUI is in use.
boolean - isLogged true if this message is to be stored somewhere.

info

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

info

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

warning

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

warning

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

error

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

error

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

error

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

error

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

syserror

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

syserror

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

syserror

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

syserror

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

setAutoFlush

public 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:
boolean - flushEveryMessage true if the log is to be flushed every time a message is written to it.

flush

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

getCurrentLog

public java.lang.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.

setAutoLog

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

getDateFormat

public java.lang.String getDateFormat()
Returns the current Date Format
Returns:
The Date format


Copyright © Orinda Software Ltd 2011Logo