Class semper.util.log.Log
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.util.log.Log

java.lang.Object
   |
   +----semper.util.log.Log

public class Log
extends Object
implements PrefNotify
SEMPER Log class
Version:
$Revision: 1.30 $ $Date: 1997/04/08 13:18:04 $
Author:
Gulcu Ceki ([email protected]), Jose-Luis Abad-Peiro ([email protected]), Andreas Fleuti ([email protected])
See Also:
SemperBuyer, SemperSeller

Variable Index

 o CRITICAL
Corresponds to highly irrecuperable malfunction.
 o ERROR
Corresponds to serious malfunction.
 o INFO
Corresponds to progress report messages.
 o TRACE
Corresponds to debugging messages.
 o WARNING
Corresponds to situations of minor malfunction or misconfiguration.

Constructor Index

 o Log()

Method Index

 o critical(String, String)
Shorthand form of log(.., Log.CRITICAL, ..)

Strictly equivalent to the log() with the level parameter set to Log.CRITICAL.

 o error(String, String)
Shorthand form of log(.., Log.ERROR, ..)

Strictly equivalent to the log() with the level parameter set to Log.ERROR.

 o info(String, String)
Shorthand form of log(.., Log.INFO, ..)

Strictly equivalent to the log() with the level parameter set to Log.INFO.

 o init(String)
init(String fileName) shouldn't be used anymore.

I will remove this method in future!

 o loadPrefs()
loadPrefs(void) loads the log-settings from disk if possible.
 o log(Object, int, String)
Alternate log() form.
 o log(String, int, String)
Log a message.
 o notifyChange(String, String)
notifyChange is used by Preferences to inform Log.class about changes made by user using TINGUIN

Do not use this method!

 o Prefs(String, int)
Prefs.
 o setCategory(String, int)
Configure loging categories.
 o setCategory(String, int, boolean)
Configure loging categories.
 o setCategoryBag(CategoryBag)
Set the CategoryBag.
 o setCategoryBag(CategoryBag, boolean)
Set the CategoryBag and may save to disk.
 o setCategoryPrefixing(boolean)
Set whether category printing is enabled or not.
 o setCategoryPrefixing(boolean, boolean)
Set whether category printing is enabled or not and may save it to disk.
 o setDatePrinting(boolean)
Set whether date printing is enabled or not.
 o setDatePrinting(boolean, boolean)
 o setDefaultCategoryLevel(int)
Sets up the default category level of loging.
 o setDefaultCategoryLevel(int, boolean)
Sets up the default category level of loging and may save it to disk.
 o setFullFileName(String)
Set the log file.
 o setFullFileName(String, boolean)
Set the log file to use and may save to disk.
 o setStackInfoThreshold(int)
Set the stack information threshold.
 o setStackInfoThreshold(int, boolean)
Set the stack information threshold and may save it to disk.
 o setStdPrefix(String)
Set the standard prefix added to all loged messages.
 o setStdPrefix(String, boolean)
Set the standard prefix added to all loged messages and may save it to disk.
 o setThreadPrinting(boolean)
Set whether thread printing is enabled or not.
 o setThreadPrinting(boolean, boolean)
Set whether thread printing is enabled or not and may save it to disk.
 o setTimePrinting(boolean)
Set whether time printing is enabled or not.
 o setTimePrinting(boolean, boolean)
Set whether time printing is enabled or not and may save it to disk.
 o trace(String, String)
Shorthand form of log(.., Log.TRACE, ..)

Strictly equivalent to the log() with the level parameter set to Log.TRACE.

 o warning(String, String)
Shorthand form of log(.., Log.WARNING, ..)

Strictly equivalent to the log() with the level parameter set to Log.WARNING.

Variables

 o CRITICAL
  public final static int CRITICAL
Corresponds to highly irrecuperable malfunction. CRITICAL level errors should be used for extremely serious error conditions.
 o ERROR
  public final static int ERROR
Corresponds to serious malfunction. ERROR level errors should be used for highly serious error conditions.
 o WARNING
  public final static int WARNING
Corresponds to situations of minor malfunction or misconfiguration. WARNING level messages should be used for situations reflecting misconfigurations or probable programming errors.
 o INFO
  public final static int INFO
Corresponds to progress report messages. INFO level is intended for high level messages, e.g. for reporting to the user/programmer on the progress of a particular run.
 o TRACE
  public final static int TRACE
Corresponds to debugging messages. TRACE level is intended for use in isolating programming erros.

Constructors

 o Log
  public Log()

Methods

 o init
  public static void init(String s)
init(String fileName) shouldn't be used anymore.

I will remove this method in future!

Parameters:
s - the name for the logfile (without .log)
 o loadPrefs
  public static void loadPrefs() throws PreferencesException
loadPrefs(void) loads the log-settings from disk if possible. Preference.class has to be intialised. If not nothing will happend.
 o notifyChange
  public void notifyChange(String groupname,
                           String fieldname)
notifyChange is used by Preferences to inform Log.class about changes made by user using TINGUIN

Do not use this method!

Parameters:
groupname - tells me about the groupname
fieldname - tells me about the fieldname
 o Prefs
  public static boolean Prefs(String categoryList,
                              int level)
Prefs.

This method may send all log related variables to the file specified by the preference manager depending on the space separated categoryList and level parameters. Each element of the list corresponds to a specific category to which the log message belongs.

Depending on configuration options, additional information such as, stack trace , current time, date, standard prefix may also recorded.

Parameters:
categoryList - space separated list of categories to which this message pertains.
level - level of debugging; one of CRITICAL, ERROR,
Returns:
whether it was loged or not WARNING, INFO and TRACE.
 o log
  public static boolean log(String categoryList,
                            int level,
                            String message)
Log a message.

This method may send the message to the file specified by the preference manager depending on the space separated categoryList and level parameters. Each element of the list corresponds to a specific category to which the log message belongs.

Depending on configuration options, additional information such as, stack trace , current time, date, standard prefix may also recorded.

Parameters:
categoryList - space separated list of categories to which this message pertains.
level - level of debugging; one of CRITICAL, ERROR, WARNING, INFO and TRACE.
message - string to write in the log file
Returns:
whether it was loged or not
 o log
  public static boolean log(Object object,
                            int level,
                            String message)
Alternate log() form.

Similar to the previous log() method except that the category is derived from the class name of the object.

This form is retained for compatibility and should be phased out.

Parameters:
object - category is the class name of this object
message - string to write in the default log file
Returns:
whether it was loged or not
 o critical
  public static boolean critical(String categoryList,
                                 String message)
Shorthand form of log(.., Log.CRITICAL, ..)

Strictly equivalent to the log() with the level parameter set to Log.CRITICAL.

Parameters:
categoryList - space separated list of categories to which this message pertains.
message - string to write in the log file
Returns:
whether it was loged or not
 o error
  public static boolean error(String categoryList,
                              String message)
Shorthand form of log(.., Log.ERROR, ..)

Strictly equivalent to the log() with the level parameter set to Log.ERROR.

Parameters:
categoryList - space separated list of categories to which this message pertains.
message - string to write in the log file
Returns:
whether it was loged ot not
 o warning
  public static boolean warning(String categoryList,
                                String message)
Shorthand form of log(.., Log.WARNING, ..)

Strictly equivalent to the log() with the level parameter set to Log.WARNING.

Parameters:
categoryList - space separated list of categories to which this message pertains.
message - string to write in the log file
Returns:
whether it was loged
 o info
  public static boolean info(String categoryList,
                             String message)
Shorthand form of log(.., Log.INFO, ..)

Strictly equivalent to the log() with the level parameter set to Log.INFO.

Parameters:
category - space separated list of categories to which this message pertains.
message - string to write in the log file
Returns:
whether it was loged or not
 o trace
  public static boolean trace(String categoryList,
                              String message)
Shorthand form of log(.., Log.TRACE, ..)

Strictly equivalent to the log() with the level parameter set to Log.TRACE.

Parameters:
category - space separated list of categories to which this message pertains.
message - string to write in the log file
Returns:
whether it was loged or not
Throws: IOException
throws IOException
 o setFullFileName
  public static String setFullFileName(String fullFileName)
Set the log file.
Parameters:
fullFileName - The full file name for the log file.
Returns:
String Previously used log file.
 o setFullFileName
  public static String setFullFileName(String fullFileName,
                                       boolean saveit)
Set the log file to use and may save to disk.
Parameters:
fullFileName - The full file name for the log file.
saveit - if true, it will save settings to disk if false, it only change the settings
Returns:
String Previously used log file.
 o setDefaultCategoryLevel
  public static int setDefaultCategoryLevel(int level)
Sets up the default category level of loging.

Possible values (in decreasing priority) are CRITICAL, ERROR, WARNING, INFO and TRACE. Default value is INFO.

When a message does not belong to any known category it is assigned the default category level.

Parameters:
New - default
Returns:
The old default
 o setDefaultCategoryLevel
  public static int setDefaultCategoryLevel(int level,
                                            boolean saveit)
Sets up the default category level of loging and may save it to disk.

Possible values (in decreasing priority) are CRITICAL, ERROR, WARNING, INFO and TRACE. Default value is INFO.

When a message does not belong to any known category it is assigned the default category level.

Parameters:
New - default
saveit - if true, it will save settings to disk if false, it only change the settings
Returns:
The old default
 o setCategoryBag
  public static CategoryBag setCategoryBag(CategoryBag cb)
Set the CategoryBag.
Parameters:
CategoryBag - The CategoryBag.
Returns:
String Previously used CategoryBag.
 o setCategoryBag
  public static CategoryBag setCategoryBag(CategoryBag cb,
                                           boolean saveit)
Set the CategoryBag and may save to disk.
Parameters:
CategoryBag - The CategoryBag.
saveit - if true, it will save settings to disk if false, it only change the settings
Returns:
String Previously used CategoryBag.
 o setCategory
  public static void setCategory(String category,
                                 int value)
Configure loging categories.
Parameters:
category - The category to configure
value - The value of the category. Possible values are (in increasing severity ) are CRITICAL, ERROR, WARNING, INFO and TRACE.
 o setCategory
  public static void setCategory(String category,
                                 int value,
                                 boolean saveit)
Configure loging categories.
Parameters:
category - The category to configure
value - The value of the category. Possible values are (in increasing severity ) are CRITICAL, ERROR, WARNING, INFO and TRACE.
saveit - if true, it will save settings to disk if false, it only change the settings
 o setStackInfoThreshold
  public static int setStackInfoThreshold(int level)
Set the stack information threshold.

Possible values (in decreasing priority) are CRITICAL, ERROR, WARNING, INFO and TRACE. Default value is WARNING.

Stack tracing information is added for all messages of same or higher prority than the stack information threshold.

Parameters:
The - new stack info threshold.
Returns:
The old stack info threshold.
 o setStackInfoThreshold
  public static int setStackInfoThreshold(int level,
                                          boolean saveit)
Set the stack information threshold and may save it to disk.

Possible values (in decreasing priority) are CRITICAL, ERROR, WARNING, INFO and TRACE. Default value is WARNING.

Stack tracing information is added for all messages of same or higher prority than the stack information threshold.

Parameters:
The - new stack info threshold.
saveit - if true, it will save settings to disk if false, it only change the settings
Returns:
The old stack info threshold.
 o setDatePrinting
  public static boolean setDatePrinting(boolean newValue)
Set whether date printing is enabled or not. If date printing is enabled, then date information is added to all loged messages.
Parameters:
newValue - New date printing setting.
Returns:
boolean The old date printing setting.
 o setDatePrinting
  public static boolean setDatePrinting(boolean newValue,
                                        boolean saveit)
 o setTimePrinting
  public static boolean setTimePrinting(boolean newValue)
Set whether time printing is enabled or not. If time printing is enabled, then time information is added to all loged messages.
Parameters:
newValue - New time printing setting.
Returns:
boolean The old time printing setting.
 o setTimePrinting
  public static boolean setTimePrinting(boolean newValue,
                                        boolean saveit)
Set whether time printing is enabled or not and may save it to disk. If time printing is enabled, then time information is added to all loged messages.
Parameters:
newValue - New time printing setting.
saveit - if true, it will save settings to disk if false, it only change the settings
Returns:
boolean The old time printing setting.
 o setThreadPrinting
  public static boolean setThreadPrinting(boolean newValue)
Set whether thread printing is enabled or not. If thread printing is enabled, then thread information is added to all loged messages.
Parameters:
newValue - New thread printing setting.
Returns:
boolean The old thread printing setting.
 o setThreadPrinting
  public static boolean setThreadPrinting(boolean newValue,
                                          boolean saveit)
Set whether thread printing is enabled or not and may save it to disk. If thread printing is enabled, then thread information is added to all loged messages.
Parameters:
newValue - New thread printing setting.
saveit - if true, it will save settings to disk if false, it only change the settings
Returns:
boolean The old thread printing setting.
 o setCategoryPrefixing
  public static boolean setCategoryPrefixing(boolean newValue)
Set whether category printing is enabled or not. If time category printing is enabled, then the first category in the categoryList (see log()) is added to all messages.
Parameters:
newValue - New category printing setting.
Returns:
boolean The old category printing setting.
 o setCategoryPrefixing
  public static boolean setCategoryPrefixing(boolean newValue,
                                             boolean saveit)
Set whether category printing is enabled or not and may save it to disk. If time category printing is enabled, then the first category in the categoryList (see log()) is added to all messages.
Parameters:
newValue - New category printing setting.
saveit - if true, it will save settings to disk if false, it only change the settings
Returns:
boolean The old category printing setting.
 o setStdPrefix
  public static String setStdPrefix(String newValue)
Set the standard prefix added to all loged messages. The satndard prefix is a string value added to all loged messages.
Parameters:
newValue - New standard prefix.
Returns:
String The old stamdard prefix.
 o setStdPrefix
  public static String setStdPrefix(String newValue,
                                    boolean saveit)
Set the standard prefix added to all loged messages and may save it to disk. The satndard prefix is a string value added to all loged messages.
Parameters:
newValue - New standard prefix.
saveit - if true, it will save settings to disk if false, it only change the settings
Returns:
String The old stamdard prefix.

All Packages  Class Hierarchy  This Package  Previous  Next  Index