The Ice run time supplies a collection of utility classes that make use of the logger facility simpler and more convenient. Each of the
Logger interface's four operations has a corresponding helper class:
The only notable difference among these classes is the extra argument to the
Trace constructor; this argument represents the trace category.
To use one of the helper classes in your application, you simply instantiate it and compose your message:
The Ice run time defines the necessary stream insertion operators so that you can treat an instance of a helper class as if it were a standard C++ output stream. When the helper object is destroyed, its destructor logs the message you have composed. If you want to log more than one message using the same helper object, invoke the
flush method on the object to log what you have composed so far and reset the object for a new message.
The helper classes also supply insertion operators to simplify the task of logging an exception. The operators accept instances of
std::exception (from which all Ice exceptions derive) and log the string returned by the
what method. On some platforms, you can also enable the configuration property
Ice.PrintStackTraces, which causes the helper classes to log the stack trace of the exception in addition to the value of