Logger interface and severity levels. More...
Namespaces | |
namespace | mi::base::details |
Namespace for details of the Base API. | |
Classes | |
struct | mi::base::Message_details |
Structured details to log messages. More... | |
class | mi::base::ILogger |
The ILogger interface class supports logging of messages. More... | |
class | mi::base::Log_stream |
Adapts mi::base::ILogger to a standard streaming interface. More... | |
Functions | |
bool | mi::base::Message_details::is_device () const |
Checks if this event pertains to a CUDA device or the CPU. More... | |
bool | mi::base::Message_details::is_tagged (const Uint32 required_tags) const |
Checks if all required_tags are present. More... | |
Message_details & | mi::base::Message_details::host (const Uint32 id) |
Named constructor. More... | |
Message_details & | mi::base::Message_details::device (const Sint32 id) |
Named constructor. More... | |
Message_details & | mi::base::Message_details::tag (const Uint32 t) |
Named constructor. More... | |
Message_details & | mi::base::Message_details::tag (const Uint32 t, const Uint32 code) |
Named constructor. More... | |
Message_details & | mi::base::Message_details::code (const Uint32 c) |
Named constructor. More... | |
virtual void | mi::base::ILogger::message (Message_severity level, const char *module_category, const char *message) |
Emits a message to the application's log. More... | |
virtual void | mi::base::ILogger::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 | mi::base::ILogger::printf (Message_severity level, const char *module_category, const char *message,...) __attribute__((format(printf |
Emits a message to the application's log. More... | |
void | mi::base::ILogger::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... | |
mi::base::Log_stream::Log_stream (ILogger *logger, const char *module_category, Message_severity default_level=MESSAGE_SEVERITY_INFO, const Message_details &default_details=Message_details()) | |
Constructor. More... | |
mi::base::Log_stream::Log_stream (ILogger *logger, const std::string &module_category, Message_severity default_level=MESSAGE_SEVERITY_INFO, const Message_details &default_details=Message_details()) | |
Constructor. More... | |
mi::base::Log_stream::~Log_stream () throw () | |
Destructor. More... | |
void | mi::base::Log_stream::set_log_level (Message_severity level) |
Flushes the buffer if not empty, and sets the log level of the next message to the given log level. More... | |
void | mi::base::Log_stream::set_details (const Message_details &details) |
Flushes the buffer if not empty, and sets the message details of the next message. More... | |
template<typename C , typename T> | |
std::basic_ostream<C, T> & | mi::base::fatal (std::basic_ostream<C, T> &ostream) |
Manipulator for mi::base::Log_stream. More... | |
template<typename C , typename T> | |
std::basic_ostream<C, T> & | mi::base::error (std::basic_ostream<C, T> &ostream) |
Manipulator for mi::base::Log_stream. More... | |
template<typename C , typename T> | |
std::basic_ostream<C, T> & | mi::base::warning (std::basic_ostream<C, T> &ostream) |
Manipulator for mi::base::Log_stream. More... | |
template<typename C , typename T> | |
std::basic_ostream<C, T> & | mi::base::info (std::basic_ostream<C, T> &ostream) |
Manipulator for mi::base::Log_stream. More... | |
template<typename C , typename T> | |
std::basic_ostream<C, T> & | mi::base::verbose (std::basic_ostream<C, T> &ostream) |
Manipulator for mi::base::Log_stream. More... | |
template<typename C , typename T> | |
std::basic_ostream<C, T> & | mi::base::debug (std::basic_ostream<C, T> &ostream) |
Manipulator for mi::base::Log_stream. More... | |
template<typename C , typename T> | |
std::basic_ostream<C, T> & | mi::base::operator<< (std::basic_ostream<C, T> &ostream, const Message_details &md) |
Manipulator for mi::base::Log_stream. More... | |
Variables | |
Uint32 | mi::base::Message_details::host_id |
The cluster ID of the host on which the message originated. More... | |
Sint32 | mi::base::Message_details::device_id |
DEVICE_ID_XXX or a CUDA device ID. More... | |
Uint32 | mi::base::Message_details::tags |
A set of tags. More... | |
Uint32 | mi::base::Message_details::message_id |
An additional message identifier. More... | |
Logger interface and severity levels.
#include <mi/base/ilogger.h>
Constants for possible message severities.
Tags which help categorize log messages.
|
inline |
Named constructor.
std::basic_ostream<C, T> & mi::base::debug | ( | std::basic_ostream<C, T> & | ostream | ) |
Manipulator for mi::base::Log_stream.
Flushes the buffer if not empty, and sets the log level of the next message to mi::base::details::MESSAGE_SEVERITY_DEBUG.
|
inline |
Named constructor.
std::basic_ostream<C, T> & mi::base::error | ( | std::basic_ostream<C, T> & | ostream | ) |
Manipulator for mi::base::Log_stream.
Flushes the buffer if not empty, and sets the log level of the next message to mi::base::details::MESSAGE_SEVERITY_ERROR.
std::basic_ostream<C, T> & mi::base::fatal | ( | std::basic_ostream<C, T> & | ostream | ) |
Manipulator for mi::base::Log_stream.
Flushes the buffer if not empty, and sets the log level of the next message to mi::base::details::MESSAGE_SEVERITY_FATAL.
|
inline |
Named constructor.
std::basic_ostream<C, T> & mi::base::info | ( | std::basic_ostream<C, T> & | ostream | ) |
Manipulator for mi::base::Log_stream.
Flushes the buffer if not empty, and sets the log level of the next message to mi::base::details::MESSAGE_SEVERITY_INFO.
|
inline |
Checks if this event pertains to a CUDA device or the CPU.
|
inline |
Checks if all required_tags
are present.
|
inline |
Constructor.
logger | The logger object used by this stream. |
module_category | The module and the category which specify the origin and the functional area of this message. See mi::base::ILogger::message() for details. |
default_level | The default log level. Used if no other log level is selected by one of the manipulators. |
default_details | The default message details. |
|
inline |
Constructor.
logger | The logger object used by this stream. |
module_category | The module and the category which specify the origin and the functional area of this message. See mi::base::ILogger::message() for details. |
default_level | The default log level. Used if no other log level is selected by one of the manipulators. |
default_details | The default message details. |
|
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.
level | The log level which specifies the severity of the message. |
module_category | The 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. |
message | The log 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.
std::basic_ostream<C, T> & mi::base::operator<< | ( | std::basic_ostream<C, T> & | ostream, |
const Message_details & | md | ||
) |
Manipulator for mi::base::Log_stream.
Flushes the buffer if not empty, and sets the log details of the next 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.
level | The log level which specifies the severity of the message. |
module_category | The 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. |
message | The log message using printf()-like format specifiers, followed by matching arguments. The formatted message is limited to 1023 characters. |
|
inline |
Emits a message to the application's log.
This overload receives additional details which applications may use to react to certain events.
|
inline |
Flushes the buffer if not empty, and sets the message details of the next message.
|
inline |
Flushes the buffer if not empty, and sets the log level of the next message to the given log level.
|
inline |
Named constructor.
|
inline |
Named constructor.
std::basic_ostream<C, T> & mi::base::verbose | ( | std::basic_ostream<C, T> & | ostream | ) |
Manipulator for mi::base::Log_stream.
Flushes the buffer if not empty, and sets the log level of the next message to mi::base::details::MESSAGE_SEVERITY_VERBOSE.
std::basic_ostream<C, T> & mi::base::warning | ( | std::basic_ostream<C, T> & | ostream | ) |
Manipulator for mi::base::Log_stream.
Flushes the buffer if not empty, and sets the log level of the next message to mi::base::details::MESSAGE_SEVERITY_WARNING.
|
inline |
Destructor.
Flushes the buffer.
Sint32 mi::base::Message_details::device_id |
DEVICE_ID_XXX
or a CUDA device ID.
Uint32 mi::base::Message_details::host_id |
The cluster ID of the host on which the message originated.
Callers will not need to set this field; it is populated automatically by the logging module. Note that a value of HOST_ID_LOCAL
may be replaced by the host's ID.
Uint32 mi::base::Message_details::message_id |
An additional message identifier.
Uint32 mi::base::Message_details::tags |
A set of tags.