Inherits IlsIndenter.
|
static void | AddFilter (LogfileFilterFunc, IlsAny=0) |
| Adds a callback to the list of callbacks to filter error messages.
|
|
static void | AddRedirect (LogfileMessageFunc, IlsAny=0) |
| Adds a callback to the list of callbacks to redirect error messages.
|
|
static IlsLogLevel | GetLogLevel () |
| Gets the current logging level that is used to control whether or not a message is reported to the user. More...
|
|
static IlsString | GetMsgPrefix () |
| Gets the current message prefix, if any. More...
|
|
static IlsBoolean | RemoveFilter (LogfileFilterFunc, IlsAny=0) |
| Removes a callback from the list of callbacks to filter error messages.
|
|
static IlsBoolean | RemoveRedirect (LogfileMessageFunc, IlsAny=0) |
| Removes a callback from the list of callbacks to redirect error messages.
|
|
static void | SetFilter (LogfileFilterFunc=0, IlsAny=0) |
| Sets, or unsets if the callback is zero, the callback to filter error messages.
|
|
static IlsBoolean | SetLogfile (const IlsString &fileName=IlsString::Null, IlsBoolean logAndOutput=IlsFalse, IlsBoolean appendToLog=IlsFalse) |
| Redirects all messages to a file. More...
|
|
static IlsLogLevel | SetLogLevel (IlsLogLevel level) |
| Sets the current logging level to the value of the argument level for all new messages. More...
|
|
static void | SetMsgPrefix (const IlsString &prefix) |
| Sets a prefix to all messages. More...
|
|
static void | SetPrintMessagesInFull (IlsBoolean inFull) |
| Chooses to print the complete message, including the prefix information. More...
|
|
static void | SetRedirect (LogfileMessageFunc=0, IlsAny=0) |
| Sets, or unsets if the callback is zero, the callback to redirect error messages.
|
|
static void | ThrowExceptionOnExit (IlsBoolean=IlsTrue) |
| Makes library throw an exception of class IlsOnExitException which derives from IlsException ), rather than calling exit() or abort() . More...
|
|
|
ILSIMPORT IlsLogfile & | dec (IlsLogfile &) |
| Sets the printing base for integers to decimal. More...
|
|
ILSIMPORT IlsLogfile & | hex (IlsLogfile &) |
| Sets the printing base for integers to hexadecimal. More...
|
|
ILSIMPORT IlsLogfile & | IlsDebug (IlsLogfile::CategoryId, IlsLogfile::MessageId, const IlsString &, const IlsString &) |
| Creates an instance of a debug message. More...
|
|
ILSIMPORT void | IlsEOM (IlsLogfile &) |
| Appends a new line to the message and sends the message. More...
|
|
ILSIMPORT IlsLogfile & | IlsError (IlsLogfile::CategoryId, IlsLogfile::MessageId, const IlsString &, const IlsString &) |
| Creates an instance of an error. More...
|
|
ILSIMPORT IlsLogfile & | IlsFatalError (IlsLogfile::CategoryId, IlsLogfile::MessageId, const IlsString &, const IlsString &) |
| Creates an instance of a fatal error. More...
|
|
ILSIMPORT IlsLogfile & | IlsInfo (IlsLogfile::CategoryId, IlsLogfile::MessageId, const IlsString &, const IlsString &) |
| Creates an instance of an information message. More...
|
|
ILSIMPORT IlsLogfile & | IlsInternalError (IlsLogfile::CategoryId, IlsLogfile::MessageId, const IlsString &, const IlsString &) |
| Creates an instance of a internal error. More...
|
|
ILSIMPORT IlsLogfile & | IlsMsg (IlsLogfile::CategoryId, IlsLogfile::MessageId, const IlsString &, const IlsString &) |
| Creates an instance of a plain message. More...
|
|
ILSIMPORT IlsLogfile & | IlsWarn (IlsLogfile::CategoryId, IlsLogfile::MessageId, const IlsString &, const IlsString &) |
| Creates an instance of a warning. More...
|
|
ILSIMPORT IlsLogfile & | oct (IlsLogfile &) |
| Sets the printing base for integers to octal. More...
|
|
ILSIMPORT IlsLogfile & | restore (IlsLogfile &) |
| Restores the printing base to its old value. More...
|
|
This class can be used to display messages to the user.
Library: server
and mvcomp
It can be used in a multithread environment as it is multithread-safe. Also, this class buffers messages, so that messages posted from different threads do not get mixed together in the output. A message is not sent until the IlsEOM
function is encountered. A message that does not end with IlsEOM
is never posted.
- See also
IlsException
, IlsInit()
, IlsLogfile::MsgDescription
.
Redirects all messages to a file.
Depending on how the logAndOutput and appendToLog Boolean parameters are set, the messages can be redirected:
- either uniquely to a file,
- or to a file and to the normal output stream.
- In addition, the output can be appended to the logfile if desired. If the output is redirected to a file and the file already exists, the existing file is removed provided that the argument appendToLog is set to
IlsFalse
.
This function can also be set via the environment variables ILS_LOGFILE
, ILS_LOGFILE_ONLY
and ILS_LOGFILE_APPEND
.
- Setting
ILS_LOGFILE_ONLY
causes the output to go only to the logfile specified.
- Setting
ILS_LOGFILE
causes the output to go to the logfile and to the normal output stream.
- Setting
ILS_LOGFILE_APPEND
causes the output to be appended to the logfile.
This function will expand the string found so as to substitute the current process identifier if requested. If the string contains the sequence PID%
,it will be replaced with the current process identifier. This mechanism allows several clients to write to different logfiles via the environment variable.
- Parameters
-
fileName | log file name |
logAndOutput | if equal to
IlsTrue: log to file and to output
IlsFalse: log only to file.
|
appendToLog | IlsTrue to append to or IlsFalse to erase the log file when it exists |