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
-
CRITICAL
- Corresponds to highly irrecuperable malfunction.
-
ERROR
- Corresponds to serious malfunction.
-
INFO
- Corresponds to progress report messages.
-
TRACE
- Corresponds to debugging messages.
-
WARNING
- Corresponds to situations of minor malfunction or misconfiguration.
-
Log()
-
-
critical(String, String)
- Shorthand form of log(.., Log.CRITICAL, ..)
Strictly equivalent to the log() with the level parameter set to
Log.CRITICAL.
-
error(String, String)
- Shorthand form of log(.., Log.ERROR, ..)
Strictly equivalent to the log() with the level parameter set to
Log.ERROR.
-
info(String, String)
- Shorthand form of log(.., Log.INFO, ..)
Strictly equivalent to the log() with the level parameter set to
Log.INFO.
-
init(String)
- init(String fileName) shouldn't be used anymore.
I will remove this method in future!
-
loadPrefs()
- loadPrefs(void) loads the log-settings from disk if possible.
-
log(Object, int, String)
- Alternate log() form.
-
log(String, int, String)
- Log a message.
-
notifyChange(String, String)
- notifyChange is used by Preferences to inform Log.class
about changes made by user using TINGUIN
Do not use this method!
-
Prefs(String, int)
- Prefs.
-
setCategory(String, int)
- Configure loging categories.
-
setCategory(String, int, boolean)
- Configure loging categories.
-
setCategoryBag(CategoryBag)
- Set the CategoryBag.
-
setCategoryBag(CategoryBag, boolean)
- Set the CategoryBag and may save to disk.
-
setCategoryPrefixing(boolean)
- Set whether category printing is enabled or not.
-
setCategoryPrefixing(boolean, boolean)
- Set whether category printing is enabled or not and may save it to disk.
-
setDatePrinting(boolean)
- Set whether date printing is enabled or not.
-
setDatePrinting(boolean, boolean)
-
-
setDefaultCategoryLevel(int)
- Sets up the default category level of loging.
-
setDefaultCategoryLevel(int, boolean)
- Sets up the default category level of loging and may save it to disk.
-
setFullFileName(String)
- Set the log file.
-
setFullFileName(String, boolean)
- Set the log file to use and may save to disk.
-
setStackInfoThreshold(int)
- Set the stack information threshold.
-
setStackInfoThreshold(int, boolean)
- Set the stack information threshold and may save it to disk.
-
setStdPrefix(String)
- Set the standard prefix added to all loged messages.
-
setStdPrefix(String, boolean)
- Set the standard prefix added to all loged messages and may save it to disk.
-
setThreadPrinting(boolean)
- Set whether thread printing is enabled or not.
-
setThreadPrinting(boolean, boolean)
- Set whether thread printing is enabled or not and may save it to disk.
-
setTimePrinting(boolean)
- Set whether time printing is enabled or not.
-
setTimePrinting(boolean, boolean)
- Set whether time printing is enabled or not and may save it to disk.
-
trace(String, String)
- Shorthand form of log(.., Log.TRACE, ..)
Strictly equivalent to the log() with the level parameter set to
Log.TRACE.
-
warning(String, String)
- Shorthand form of log(.., Log.WARNING, ..)
Strictly equivalent to the log() with the level parameter set to
Log.WARNING.
CRITICAL
public final static int CRITICAL
- Corresponds to highly irrecuperable malfunction.
CRITICAL level errors should be used for extremely serious error
conditions.
ERROR
public final static int ERROR
- Corresponds to serious malfunction.
ERROR level errors should be used for highly serious error
conditions.
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.
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.
TRACE
public final static int TRACE
- Corresponds to debugging messages.
TRACE level is intended for use in isolating programming erros.
Log
public Log()
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)
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.
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
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.
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
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
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
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
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
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
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
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.
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.
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
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
setCategoryBag
public static CategoryBag setCategoryBag(CategoryBag cb)
- Set the CategoryBag.
- Parameters:
- CategoryBag - The CategoryBag.
- Returns:
- String Previously used CategoryBag.
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.
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.
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
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.
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.
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.
setDatePrinting
public static boolean setDatePrinting(boolean newValue,
boolean saveit)
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.
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.
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.
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.
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.
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.
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.
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