com.orindasoft.pub
Interface LogInterface

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

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-2012 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

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

See Also:
Constant Field Values

INFO

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

See Also:
Constant Field Values

WARN

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

See Also:
Constant Field Values

ERROR

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

See Also:
Constant Field Values

SYSERR

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

See Also:
Constant Field Values

DEFAULT_TIME_FORMAT_STRING

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

See Also:
Constant Field Values

DEFAULT_FILENAME_DAY_FORMAT

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

See Also:
Constant Field Values

DEFAULT_FILENAME_TIME_FORMAT

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

See Also:
Constant Field Values

DEFAULT_FIELD_DELIMITER

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

See Also:
Constant Field Values
Method Detail

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(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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


getCurrentLog

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

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

java.lang.String getDateFormat()
Returns the current Date Format

Returns:
The Date format


Copyright © Orinda Software Ltd 2012Logo