|
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.ITLogMsg
Logmessages are flexible container objects collecting information about the logging application.
Each logmessage is linked to a (primary) output logchannel (represented by
an instance).
The output behaviour of such output logchannels can be (re)configured
at runtime (using online configuration) (using the ITConfigManager application).
ITOutputLogChannel
ITLogMsg objects are optimized for usability and performance, for instance:
| Constructor Summary | |
ITLogMsg()
Contructs a null (or empty) LogMsg instance.
|
|
ITLogMsg(String sModule,
String sCase)
Contructs a logmessage with default loglevel ( )
for the default logchannel ('StdLog').
|
|
ITLogMsg(String sModule,
String sCase,
short shtLogLevel)
Constructs a logmessage for the default logchannel 'StdLog'. |
|
ITLogMsg(String sModule,
String sCase,
short shtLogLevel,
String sLogChannel)
Constructs a logmessage for a given logchannel. |
|
| Method Summary | |
void |
add(char c)
Streams a character to the logmessage text. |
void |
add(double d)
Streams a double to the logmessage text. |
void |
add(float f)
Streams a float to the logmessage text. |
void |
add(int i)
Streams an integer to the logmessage text. |
void |
add(String sText)
Streams a string to the logmessage text. |
void |
addLogLevel(short shtLogLevel)
Adds an additional loglevel to the current loglevel of the logmessage. |
boolean |
addParam(String sName,
char c)
Adds a named char parameter including its value to the logmessage. |
boolean |
addParam(String sName,
char c,
boolean bCopyValueToMsgText)
Adds a named char parameter including its value to the logmessage. |
boolean |
addParam(String sName,
char c,
boolean bCopyValueToMsgText,
boolean bCopyParamNameToMsgText)
Adds a named char parameter including its value to the logmessage. |
boolean |
addParam(String sName,
double d)
Adds a named double parameter including its value to the logmessage. |
boolean |
addParam(String sName,
double d,
boolean bCopyValueToMsgText)
Adds a named double parameter including its value to the logmessage. |
boolean |
addParam(String sName,
double d,
boolean bCopyValueToMsgText,
boolean bCopyParamNameToMsgText)
Adds a named double parameter including its value to the logmessage. |
boolean |
addParam(String sName,
float f)
Adds a named float parameter including its value to the logmessage. |
boolean |
addParam(String sName,
float f,
boolean bCopyValueToMsgText)
Adds a named float parameter including its value to the logmessage. |
boolean |
addParam(String sName,
float f,
boolean bCopyValueToMsgText,
boolean bCopyParamNameToMsgText)
Adds a named float parameter including its value to the logmessage. |
boolean |
addParam(String sName,
int i)
Adds a named integer parameter including its value to the logmessage. |
boolean |
addParam(String sName,
int i,
boolean bCopyValueToMsgText)
Adds a named integer parameter including its value to the logmessage. |
boolean |
addParam(String sName,
int i,
boolean bCopyValueToMsgText,
boolean bCopyParamNameToMsgText)
Adds a named integer parameter including its value to the logmessage. |
boolean |
addParam(String sName,
String sValue)
Adds a named string parameter including its value to the logmessage. |
boolean |
addParam(String sName,
String sValue,
boolean bCopyValueToMsgText)
Adds a named string parameter including its value to the logmessage. |
boolean |
addParam(String sName,
String sValue,
boolean bCopyValueToMsgText,
boolean bCopyParamNameToMsgText)
Adds a named string parameter including its value to the logmessage. |
boolean |
cancel()
Prevents the logmessage from sending to its output logchannel(s). |
void |
create(String sModule,
String sCase)
Creates a logmessage with default loglevel ( )
for the default logchannel ('StdLog').
|
void |
create(String sModule,
String sCase,
short shtLogLevel)
Creates a logmessage for the default logchannel 'StdLog'. |
void |
create(String sModule,
String sCase,
short shtLogLevel,
String sLogChannel)
Creates a logmessage for a given logchannel. |
protected void |
finalize()
Sends the logmessage automatically to its logchannel(s), by calling its send() method. |
String |
getCase()
Returns the case name of the logmessage. |
String |
getLogChannelName()
Returns the name of the (primary) logchannel as passed in the constructor or create method. |
short |
getLogLevel()
Returns the loglevel (combination) of the logmessage. |
String |
getModule()
Returns the module name of the logmessage. |
String |
getText()
Returns the logmessage text. |
String |
getTimeAsString()
Returns the timestamp (date and time) of the logmessage as a string. |
boolean |
isNullLogMsg()
Returns whether the logmessage is the null LogMsg object,
a special instance used for performance optimization of suppressed
logmessages.
|
boolean |
send()
Sends the logmessage -- as it currently is -- to its output logchannel(s). |
void |
setLogLevel(short shtLogLevel)
Sets the loglevel (combination) of the logmessage. |
boolean |
willBeLogged()
Returns whether the logmessage will be logged by at least one of its (forwarding) logchannels. |
boolean |
willBeLoggedTo(String sLogChannel)
Returns whether the logmessage will be logged to a special (forwarding) logchannel. |
| Methods inherited from class Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ITLogMsg()
LogMsg instance.
Internally all these null instances refer to the same empty implementation
object, which has empty add(java.lang.String), addLogLevel(short) and similar
methods for performance optimization.
Depending the control flow of your programm, you may create a non-null
logmessage in a subsequent call to one of the create(java.lang.String, java.lang.String) methods
of this ITLogMsginstance.
public ITLogMsg(String sModule,
String sCase)
LEVEL_INFO)
for the default logchannel ('StdLog').
Note: If the Module/Case combination does not pass the write-out
filter condition (currently defined for the logchannel in the configuration
file), the object is automatically changed internally to a null logmessage
(a special, performance optimized ITLogMsg instance).
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.
public ITLogMsg(String sModule,
String sCase,
short shtLogLevel)
Note: If the Module/Case combination does not pass the write-out filter
condition (currently defined for the logchannel in the configuration file)
the object is switched automatically to a null logmessage (a special,
performance optimized ITLogMsg instance).
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.shtLogLevel - one or more ITLogLevel constants
(LEVEL_INFO,
LEVEL_WARNING,
LEVEL_ERROR,
LEVEL_ALARM),
combined by '|' (bitwise or).
public ITLogMsg(String sModule,
String sCase,
short shtLogLevel,
String sLogChannel)
Note: If the logchannel is not open or the Module/Case combination does
not pass the write-out filter condition
(currently defined for the logchannel in the configuration file)
the object automatically is switched to a null logmessage
(a special, performance optimized ITLogMsg instance).
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.shtLogLevel - one or more ITLogLevel constants
(LEVEL_INFO,
LEVEL_WARNING,
LEVEL_ERROR,
LEVEL_ALARM),
combined by '|' (bitwise or).| Method Detail |
protected void finalize()
send() method. Please don't rely on this mechanism, as
it isn't secure and also sends the logmessage very late, not at the
moment it should be sent. Send logmessages yourself when they are
ready to be sent!
finalize in class ObjectITLogMsg.sendpublic boolean isNullLogMsg()
LogMsg object,
a special instance used for performance optimization of suppressed
logmessages.
Note: The write-out filter(s) of the (forwarding) logchannel(s) determine(s) during the creation of the logmessage if it will be logged or not.
true if the logmessage is the null
LogMsg object
false otherwise
ITLogMsg.willBeLogged,
ITLogMsg.willBeLoggedTo,
ITLogMsg.cancel
public void create(String sModule,
String sCase)
LEVEL_INFO)
for the default logchannel ('StdLog').
Note: If the Module/Case combination does not pass the write-out filter
condition (currently defined for the logchannel in the configuration file)
the object automatically is switched to a null logmessage
(a special, performance optimized ITLogMsg instance).
Note: If the object is reused, the previous logmessage will be sent automatically.
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.
ITLogMsg.send
public void create(String sModule,
String sCase,
short shtLogLevel)
Note: If the Module/Case combination does not pass the write-out filter
condition (currently defined for the logchannel in the configuration file),
the object automatically is switched to the a null logmessage
(a special, performance optimized ITLogMsg instance).
Note: If the object is reused, the previous logmessage will be sent automatically.
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.shtLogLevel - one or more ITLogLevel constants
(LEVEL_INFO,
LEVEL_WARNING,
LEVEL_ERROR,
LEVEL_ALARM),
combined by '|' (bitwise or).ITLogMsg.send
public void create(String sModule,
String sCase,
short shtLogLevel,
String sLogChannel)
Note: If the logchannel is not open or the Module/Case combination does
not pass the write-out filter condition (currently defined for the
logchannel in the configuration file),
the object automatically is switched to a null logmessage (a a special,
performance optimized ITLogMsg instance).
Note: If the object is reused, the previous logmessage will be sent automatically.
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.shtLogLevel - one or more ITLogLevel constants
(LEVEL_INFO,
LEVEL_WARNING,
LEVEL_ERROR,
LEVEL_ALARM),
combined by '|' (bitwise or).ITLogMsg.sendpublic void add(String sText)
Note: This method does nothing if the logmessage will not be logged.
sText - Text string to append to the logmessage text.
ITLogMsg.willBeLoggedpublic void add(char c)
Note: This method does nothing if the logmessage will not be logged.
c - character to append to the logmessage text.
ITLogMsg.willBeLoggedpublic void add(int i)
Note: This method does nothing if the logmessage will not be logged.
i - integer value to append (as string) to the logmessage text.
ITLogMsg.willBeLoggedpublic void add(double d)
Note: This method does nothing if the logmessage will not be logged.
d - double value to append (as string) to the logmessage text.
ITLogMsg.willBeLoggedpublic void add(float f)
Note: This method does nothing if the logmessage will not be logged.
f - float value to append (as string) to the logmessage text.
ITLogMsg.willBeLoggedpublic boolean send()
Note:
ITLogMsg.willBeLogged always return true
true if the logmessage was sent by this call
(That is, if ITLogMsg.willBeLogged
returned true before the call.)
false otherwise
ITLogMsg.cancel,
ITLogMsg.isNullLogMsg,
ITLogMsg.willBeLogged,
ITLogMsg.willBeLoggedTopublic boolean cancel()
Note:
ITLogMsg.willBeLogged always return true
true if the logmessage was cancelled by this call
(That is, if ITLogMsg.willBeLogged
returned true before the call.)
false otherwise
ITLogMsg.send,
ITLogMsg.isNullLogMsg,
ITLogMsg.willBeLogged,
ITLogMsg.willBeLoggedTopublic boolean willBeLogged()
Note: The write-out filter(s) of the (forwarding) logchannel(s) determin(e) during its creation if the logmessage will be logged or not.
true if the logmessage will be logged
(is created, but not cancelled or already sent)
false otherwise
ITLogMsg.willBeLoggedTo,
ITLogMsg.cancel,
ITLogMsg.isNullLogMsgpublic boolean willBeLoggedTo(String sLogChannel)
Note: The write-out filter(s) of the (forwarding) logchannel(s) determine(s) during the creation of the logmessage if it will be logged or not. *
sLogChannel - name of the logchannel to test.
true if the logmessage will be logged to this
logchannel (is created, but not cancelled or already sent)
false otherwise
ITLogMsg.willBeLogged,
ITLogMsg.isNullLogMsg,
ITLogMsg.cancelpublic String getLogChannelName()
ITLogMsg.willBeLogged
returned true)
ITLogMsg.getLogLevel,
ITLogMsg.getTimeAsString,
ITLogMsg.getModule,
ITLogMsg.getCase,
ITLogMsg.getTextpublic short getLogLevel()
Note: Use the '&' operator (bitwise AND) to extract a single loglevel
bit value
(,
LEVEL_INFO,
LEVEL_WARNING or
LEVEL_ERROR).
LEVEL_ALARM
ITLogMsg.willBeLogged
returned true)
ITLogMsg.getLogChannelName,
ITLogMsg.getTimeAsString,
ITLogMsg.getModule,
ITLogMsg.getCase,
ITLogMsg.getTextpublic String getTimeAsString()
Note: The format of the timestamp is 'DD.MM.YYYY hh:mm:ss'
ITLogMsg.willBeLogged
returned true)
ITLogMsg.getLogChannelName,
ITLogMsg.getLogLevel,
ITLogMsg.getModule,
ITLogMsg.getCase,
ITLogMsg.getTextpublic String getModule()
ITLogMsg.willBeLogged
returned true)
ITLogMsg.getLogChannelName,
ITLogMsg.getLogLevel,
ITLogMsg.getTimeAsString,
ITLogMsg.getCase,
ITLogMsg.getTextpublic String getCase()
ITLogMsg.willBeLogged
returned true)
ITLogMsg.getLogChannelName,
ITLogMsg.getLogLevel,
ITLogMsg.getTimeAsString,
ITLogMsg.getModule,
ITLogMsg.getTextpublic String getText()
ITLogMsg.willBeLogged
returned true)
ITLogMsg.getLogChannelName,
ITLogMsg.getLogLevel,
ITLogMsg.getTimeAsString,
ITLogMsg.getModule,
ITLogMsg.getCasepublic void setLogLevel(short shtLogLevel)
shtLogLevel - one or more Loglevel constants
(LEVEL_INFO,
LEVEL_WARNING,
LEVEL_ERROR,
LEVEL_ALARM),
combined by '|' (bitwise OR).
ITLogMsg.addLogLevel,
ITLogMsg.getLogLevelpublic void addLogLevel(short shtLogLevel)
shtLogLevel - one or more Loglevel constants
(LEVEL_INFO,
LEVEL_WARNING,
LEVEL_ERROR,
LEVEL_ALARM),
combined by '|' (bitwise OR).
ITLogMsg.setLogLevel,
ITLogMsg.getLogLevel
public boolean addParam(String sName,
String sValue)
sName - parameter namesValue - parameter value
true
public boolean addParam(String sName,
String sValue,
boolean bCopyValueToMsgText)
sName - parameter namesValue - parameter valuebCopyValueToMsgText - indicates if the parameter value will
additionally be appended to the logmessage text.
Note:
true
public boolean addParam(String sName,
String sValue,
boolean bCopyValueToMsgText,
boolean bCopyParamNameToMsgText)
sName - parameter namesValue - parameter valuebCopyValueToMsgText - indicates if the parameter value will
additionally be appended to the logmessage text.bCopyParamNameToMsgText - indicates if the parameter name will
additionally be appended to the logmessage text.
Note:
true
public boolean addParam(String sName,
char c)
sName - parameter namec - parameter value
true
public boolean addParam(String sName,
char c,
boolean bCopyValueToMsgText)
sName - parameter namec - parameter valuebCopyValueToMsgText - indicates if the parameter value will
additionally be appended to the logmessage text.
Note:
true
public boolean addParam(String sName,
char c,
boolean bCopyValueToMsgText,
boolean bCopyParamNameToMsgText)
sName - parameter namec - parameter valuebCopyValueToMsgText - indicates if the parameter value will
additionally be appended to the logmessage text.bCopyParamNameToMsgText - indicates if the parameter name will
additionally be appended to the logmessage text.
Note:
true
public boolean addParam(String sName,
int i)
sName - parameter namei - parameter value
true
public boolean addParam(String sName,
int i,
boolean bCopyValueToMsgText)
sName - parameter namei - parameter valuebCopyValueToMsgText - indicates if the parameter value will
additionally be appended as a string to the logmessage text.
Note:
true
public boolean addParam(String sName,
int i,
boolean bCopyValueToMsgText,
boolean bCopyParamNameToMsgText)
sName - parameter namei - parameter valuebCopyValueToMsgText - indicates if the parameter value will
additionally be appended as a string to the logmessage text.bCopyParamNameToMsgText - indicates if the parameter name will
additionally be appended to the logmessage text.
Note:
true
public boolean addParam(String sName,
double d)
sName - parameter named - parameter value
true
public boolean addParam(String sName,
double d,
boolean bCopyValueToMsgText)
sName - parameter named - parameter valuebCopyValueToMsgText - indicates if the parameter value will
additionally be appended as a string to the logmessage text.
Note:
true
public boolean addParam(String sName,
double d,
boolean bCopyValueToMsgText,
boolean bCopyParamNameToMsgText)
sName - parameter named - parameter valuebCopyValueToMsgText - indicates if the parameter value will
additionally be appended as a string to the logmessage text.bCopyParamNameToMsgText - indicates if the parameter name will
additionally be appended to the logmessage text.
Note:
true
public boolean addParam(String sName,
float f)
sName - parameter namef - parameter value
true
public boolean addParam(String sName,
float f,
boolean bCopyValueToMsgText)
sName - parameter namef - parameter valuebCopyValueToMsgText - indicates if the parameter value will
additionally be appended as a string to the logmessage text.
Note:
true
public boolean addParam(String sName,
float f,
boolean bCopyValueToMsgText,
boolean bCopyParamNameToMsgText)
sName - parameter namef - parameter valuebCopyValueToMsgText - indicates if the parameter value will
additionally be appended as a string to the logmessage text.bCopyParamNameToMsgText - indicates if the parameter name will
additionally be appended to the logmessage text.
Note:
true
|
ITLogLib2/Java Help version: Wed 07 Jul 2004 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||