Material Definition Language API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::base::ILogger Class Referenceabstract

The ILogger interface class supports logging of messages. More...

Inheritance diagram for mi::base::ILogger:
mi::base::Interface_declare< 0x4afbf19a, 0x5fb7, 0x4422, 0xae, 0x4b, 0x25, 0x13, 0x06, 0x2c, 0x30, 0x5f > mi::base::IInterface

Public Member Functions

virtual void message (Message_severity level, const char *module_category, const char *message)
 Emits a message to the application's log. More...
 
virtual void message (Message_severity level, const char *module_category, const Message_details &, const char *message)=0
 Emits a message to the application's log. More...
 
void printf (Message_severity level, const char *module_category, const char *message,...) __attribute__((format(printf
 Emits a message to the application's log. More...
 
void printf (Message_severity level, const char *module_category, const Message_details &details, const char *message,...) __attribute__((format(printf
 Emits a message to the application's log. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x4afbf19a, 0x5fb7, 0x4422, 0xae, 0x4b, 0x25, 0x13, 0x06, 0x2c, 0x30, 0x5f >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface
Self
 Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x4afbf19a, 0x5fb7, 0x4422, 0xae, 0x4b, 0x25, 0x13, 0x06, 0x2c, 0x30, 0x5f >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

The ILogger interface class supports logging of messages.

Plugins based on mi::base::Plugin are provided with a logger, such that plugins can be written to use the same message log as the host application.

Different APIs allow to register your own implementation of a logger to override their internal implementation. Note that in such case the object implementing this interface shall not be created on the stack, since this might lead to premature destruction of such instances while still being in use by the API.

The following message categories are used in some APIs. There might be other, undocumented categories.

category purpose
"DATABASE" database
"DISK" raw disk I/O, swapping
"GEOMETRY" geometry processing, e.g., tessellation
"IMAGE" texture processing, image and video plugins
"IO" scene data import and export
"MAIN" reserved for the application itself
"MISC" other
"MEMORY" memory management
"NETWORK" networking
"PLUGIN" plugins (unless other categories fit better)
"RENDER" rendering

Member Function Documentation

virtual void mi::base::ILogger::message ( Message_severity  level,
const char *  module_category,
const char *  message 
)
inlinevirtual

Emits a message to the application's log.

The application can decide to output the message to any channel or to drop it.

This function can be called at any time from any thread, including concurrent calls from several threads at the same time.

Note
Severity mi::base::details::MESSAGE_SEVERITY_FATAL indicates that the caller is unable to recover from the error condition. Therefore, the process will be terminated after a fatal log message has been delivered. To avoid the process termination logger implementations might choose not to return from this method for fatal log messages. This severity should only be used in exceptional cases.
Parameters
levelThe log level which specifies the severity of the message.
module_categoryThe module and the category which specify the origin and the functional area of this message. The format of string parameter is "module:category". Both names are optional. The module name must not contain any colons. See above for valid category names.
messageThe log message.
virtual void mi::base::ILogger::message ( Message_severity  level,
const char *  module_category,
const Message_details ,
const char *  message 
)
pure virtual

Emits a message to the application's log.

This overload receives additional details which applications may use to react to certain events.

void mi::base::ILogger::printf ( Message_severity  level,
const char *  module_category,
const char *  message,
  ... 
)
inline

Emits a message to the application's log.

The application can decide to output the message to any channel or to drop it.

This function can be called at any time from any thread, including concurrent calls from several threads at the same time.

Note
Severity mi::base::details::MESSAGE_SEVERITY_FATAL indicates that the caller is unable to recover from the error condition. Therefore, the process will be terminated after a fatal log message has been delivered. To avoid the process termination logger implementations might choose not to return from this method for fatal log messages. This severity should only be used in exceptional cases.
Parameters
levelThe log level which specifies the severity of the message.
module_categoryThe module and the category which specify the origin and the functional area of this message. The format of string parameter is "module:category". Both names are optional. The module name must not contain any colons. See above for valid category names.
messageThe log message using printf()-like format specifiers, followed by matching arguments. The formatted message is limited to 1023 characters.
void mi::base::ILogger::printf ( Message_severity  level,
const char *  module_category,
const Message_details details,
const char *  message,
  ... 
)
inline

Emits a message to the application's log.

This overload receives additional details which applications may use to react to certain events.