|
ITLogLib2/Java Help version: Wed 07 Jul 2004 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--de.itechsoftware.itloglib2.ITLogLib
This class represents a singleton which provides the administrative
methods of the logging library. All methods are static
ITLogLib is used to:
| Method Summary | |
static boolean |
closeLogChannel(String sLogChannelName)
Closes the designated logchannel - if open an flushes all pending logmessages. |
static boolean |
deinitialize()
Deinitializes the logging library - if not already deinitialized. |
static String |
getConfigFile()
Returns the name of the configuration file. |
static int |
getLastErrorCode()
Returns the error code of the last error. |
static String |
getLastErrorDescription()
Returns details about the last unsuccessful method call. |
static ITOutputLogChannel |
getLogChannel(String sLogChannelName)
Returns an instance for the designated logchannel. |
static String |
getRegistrySettingCurrentUser(String sKeyName,
String sValueName)
Helper method - Reads Windows registry string data from HKEY_CURRENT_USER. |
static String |
getRegistrySettingLocalMachine(String sKeyName,
String sValueName)
Helper method - Reads Windows registry string data from HKEY_LOCAL_MACHINE. |
static boolean |
initialize(String sAppName,
String sConfigFile,
String sLicenseKey)
Initializes the logging library - if not already initialized. |
static boolean |
isInitialized()
Returns the initialization status of the logging library. |
static ITOutputLogChannel |
openLogChannel(String sLogChannelName)
Opens a logchannel - if not already opened. |
static void |
quickLog(String sModule,
String sCase,
String sText)
Creates a logmessage with default loglevel ( ) and sends it
to the default logchannel ('StdLog') (in a single statement).
|
static void |
quickLog(String sModule,
String sCase,
String sText,
short shtLogLevel)
Creates a logmessage and send it to the default logchannel 'StdLog'. |
static void |
quickLog(String sModule,
String sCase,
String sText,
short shtLogLevel,
String sLogChannelName)
Creates a logmessage and sends it to the specified logchannel. |
static boolean |
runApplication(String sApplication)
Helper method - Calls |
static boolean |
runApplication(String sApplication,
String sParameters)
Helper method - Calls |
static boolean |
runApplication(String sApplication,
String sParameters,
String sDefaultDir)
Helper method - Starts an external application like ITLogBook, ITConfigManager or any other program. |
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static boolean initialize(String sAppName,
String sConfigFile,
String sLicenseKey)
sAppName - the name of your logging application.sConfigFile - the name of the logging configuration file (*.icf).
If necessary, include the path.
(The path can be absolute or relative to the working directory of your
application.)sLicenseKey - the license key for the logging library.
true after successful initialization
(You get this return value too, if the logging library already was
initialized before the call.)
false if an error occurred.
Possible errors:
ITLogLib.getLastErrorDescriptionITLogLib.deinitialize,
ITLogLib.isInitializedpublic static boolean deinitialize()
Note that this method endlessly tries to flush the buffered logmessages and returns only after succeeding.
true after successful deinitialization
(You get this return value too if the logging library was
not initialized before the call.)
false if an error occurred.
ITLogLib.initialize,
ITLogLib.isInitializedpublic static boolean isInitialized()
true if the logging library initialized successfullyfalse otherwise
ITLogLib.initialize,
ITLogLib.deinitializepublic static ITOutputLogChannel openLogChannel(String sLogChannelName)
Note that the standard logchannel (StdLog) is already opened as part of a successful initialization of the logging library.
sLogChannelName - the name of the logchannel (case sensitive),
as defined in the configuration file.
null otherwise.
Possible errors:
ITLogLib.closeLogChannel,
ITLogLib.getLogChannel,
ITOutputLogChannel.isOpenpublic static ITOutputLogChannel getLogChannel(String sLogChannelName)
sLogChannelName - the name of the logchannel (case sensitive).
null otherwise.
ITLogLib.openLogChannel,
ITLogLib.closeLogChannel,
ITOutputLogChannel.isOpenpublic static boolean closeLogChannel(String sLogChannelName)
Note that the standard logchannel 'StdLog' can not be closed explicitely.
sLogChannelName - the name of the logchannel (case sensitive).
true if the logchannel closed successfully
(You get this return value too if the logchannel wasn't
open before the call.)false otherwise
ITLogLib.openLogChannel,
ITLogLib.getLogChannel,
ITOutputLogChannel.isOpenpublic static String getConfigFile()
ITLogLib.initialize
ITLogLib.initializepublic static int getLastErrorCode()
ITLogLib.getLastErrorDescriptionpublic static String getLastErrorDescription()
ITLogLib.getLastErrorCode
public static void quickLog(String sModule,
String sCase,
String sText)
LEVEL_INFO) and sends it
to the default logchannel ('StdLog') (in a single statement).
Note: If the logchannel was not open successfully or the Module/Case combination does not pass the write-out filter condition (currently defined for the logchannel in the configuration file), the logmessage will not be generated.
sModule - user-defined specifier, describing a module or subsystem
of the logging application.sCase - user-defined specifier, describing a use-case or operation
of the logging application.sText - logmessage text.
public static void quickLog(String sModule,
String sCase,
String sText,
short shtLogLevel)
Note: If the logchannel was not open successfully or the Module/Case combination does not pass the write-out filter condition (currently defined for the logchannel in the configuration file), the logmessage will not be generated.
sModule - user-defined specifier, describing a module or subsystem
of the logging application.sCase - user-defined specifier, describing a use-case or operation
of the logging application.sText - logmessage text.shtLogLevel - one or more ITLogLevel constants
(LEVEL_INFO,
LEVEL_WARNING,
LEVEL_ERROR,
LEVEL_ALARM),
combined by '|' (bitwise or).
public static void quickLog(String sModule,
String sCase,
String sText,
short shtLogLevel,
String sLogChannelName)
Note: If the logchannel was not open successfully or the Module/Case combination does not pass the write-out filter condition (currently defined for the logchannel in the configuration file), the logmessage will not be generated.
sModule - user-defined specifier, describing a module or subsystem
of the logging application.sCase - user-defined specifier, describing a use-case or operation
of the logging application.sText - logmessage text.shtLogLevel - one or more ITLogLevel constants
(LEVEL_INFO,
LEVEL_WARNING,
LEVEL_ERROR,
LEVEL_ALARM),
combined by '|' (bitwise or).sLogChannelName - logchannel name.
public static boolean runApplication(String sApplication,
String sParameters,
String sDefaultDir)
Sample:
To view the current logfile:
ITLogLib.runApplication(
ITLogLib.getLogChannel("StdLog").getCurrentLogFile(), "", "")
To view the current configuration file:
ITLogLib.runApplication(ITLogLib.getConfigFile(), "", "")
sApplication - name of the application to start or name of a file
(in the latter case the extension of the file must be associated with
a program to start)sParameters - parameters required by the started application (optional)sDefaultDir - path to the default directory the application should
work with (optional)
true if successfulfalse otherwise.
public static boolean runApplication(String sApplication,
String sParameters)
runApplication(sApplication, sParameters, "")
public static boolean runApplication(String sApplication)
runApplication(sApplication, "", "")
public static String getRegistrySettingLocalMachine(String sKeyName,
String sValueName)
sKeyName - registry key (may include subkeys, separated by '\')sValueName - registry value ("" to read the default value of the key)
ITLogLib.getRegistrySettingCurrentUser
public static String getRegistrySettingCurrentUser(String sKeyName,
String sValueName)
sKeyName - registry key (may include subkeys, separated by '\')sValueName - registry value ("" to read the default value of the key)
ITLogLib.getRegistrySettingLocalMachine
|
ITLogLib2/Java Help version: Wed 07 Jul 2004 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||