Logger Facility

The Ice runtime logs trace messages, warnings, and errors through the LoggerLoggerLoggerLoggerLoggerLoggerLogger interface. The Ice.Trace.* and Ice.Warn.* properties select which trace messages and warnings it logs.

A logger provides one method for each kind of message:

  • print logs a message as is, without a timestamp or prefix.
  • trace logs a trace message in a category.
  • warning logs a warning.
  • error logs an error.

The Ice::Print, Ice::Trace, Ice::Warning, and Ice::Error helper classes let you compose a message with the << operator. The helper sends the message to the logger when you call flush or when the helper is destroyed:

C++
Ice::Trace out{communicator->getLogger(), "Greeter"};
out << "greeting " << name;