The logging manager. Owns the log sink and potentially provides a default Logger instance. Provides filtering based on a minimum LogSeverity level, and of messages with DataType::User if enabled.
More...
#include <logging.h>
The logging manager. Owns the log sink and potentially provides a default Logger instance. Provides filtering based on a minimum LogSeverity level, and of messages with DataType::User if enabled.
Definition at line 102 of file logging.h.
Enumerator |
---|
Default |
Default instance of LoggingManager that should exist for the lifetime of the program.
|
Temporal |
Temporal instance. CreateLogger(...) should be used, however DefaultLogger() will NOT be provided via this instance.
|
Definition at line 104 of file logging.h.
onnxruntime::logging::LoggingManager::LoggingManager |
( |
std::unique_ptr< ISink > |
sink, |
|
|
Severity |
default_min_severity, |
|
|
bool |
default_filter_user_data, |
|
|
InstanceType |
instance_type, |
|
|
const std::string * |
default_logger_id = nullptr , |
|
|
int |
default_max_vlog_level = -1 |
|
) |
| |
Initializes a new instance of the LoggingManager class.
- Parameters
-
sink | The sink to write to. Use CompositeSink if you need to write to multiple places. |
default_min_severity | The default minimum severity. Messages with lower severity will be ignored unless overridden in CreateLogger. |
default_filter_user_data | If set to true ignore messages with DataType::USER unless overridden in CreateLogger. |
instance_type | If InstanceType::Default, this is the default instance of the LoggingManager and is expected to exist for the lifetime of the program. It creates and owns the default logger that calls to the static DefaultLogger method return. |
default_logger_id | Logger Id to use for the default logger. nullptr/ignored if instance_type == Temporal. |
default_max_vlog_level | Default maximum level for VLOG messages to be created unless overridden in CreateLogger. Requires a severity of kVERBOSE for VLOG messages to be logged. |
onnxruntime::logging::LoggingManager::~LoggingManager |
( |
| ) |
|
std::unique_ptr<Logger> onnxruntime::logging::LoggingManager::CreateLogger |
( |
const std::string & |
logger_id | ) |
|
Creates a new logger instance which will use the provided logger_id and default severity and vlog levels.
- Parameters
-
logger_id | The log identifier. |
- Returns
- A new Logger instance that the caller owns.
std::unique_ptr<Logger> onnxruntime::logging::LoggingManager::CreateLogger |
( |
const std::string & |
logger_id, |
|
|
Severity |
min_severity, |
|
|
bool |
filter_user_data, |
|
|
int |
max_vlog_level = -1 |
|
) |
| |
Creates a new logger instance which will use the provided logger_id, severity and vlog levels.
- Parameters
-
logger_id | The log identifier. |
min_severity | The minimum severity. Requests to create messages with lower severity will be ignored. |
filter_user_data | If set to true ignore messages with DataType::USER. |
max_vlog_level | Maximum level for VLOG messages to be created. |
- Returns
- A new Logger instance that the caller owns.
const Logger & onnxruntime::logging::LoggingManager::DefaultLogger |
( |
| ) |
|
|
inlinestatic |
Gets the default logger instance if set. Throws if no default logger is currently registered.
- Returns
- The default logger if available.
Definition at line 306 of file logging.h.
static bool onnxruntime::logging::LoggingManager::HasDefaultLogger |
( |
| ) |
|
|
inlinestatic |
Return a boolean indicating if the default logger has been initialized
Definition at line 157 of file logging.h.
void onnxruntime::logging::LoggingManager::Log |
( |
const std::string & |
logger_id, |
|
|
const Capture & |
message |
|
) |
| const |
Logs the message using the provided logger id.
- Parameters
-
logger_id | The log identifier. |
message | The log message. |
static std::exception onnxruntime::logging::LoggingManager::LogFatalAndCreateException |
( |
const char * |
category, |
|
|
const CodeLocation & |
location, |
|
|
const char * |
format_str, |
|
|
|
... |
|
) |
| |
|
static |
Logs a FATAL level message and creates an exception that can be thrown with error information.
- Parameters
-
category | The log category. |
location | The location the log message was generated. |
format_str | The printf format string. |
... | The printf arguments. |
- Returns
- A new Logger instance that the caller owns.
Sends a Profiling Event Record to the sink.
- Parameters
-
void onnxruntime::logging::LoggingManager::SetDefaultLoggerSeverity |
( |
Severity |
severity | ) |
|
|
inlinestatic |
Change the minimum severity level for log messages to be output by the default logger.
- Parameters
-
Definition at line 315 of file logging.h.
void onnxruntime::logging::LoggingManager::SetDefaultLoggerVerbosity |
( |
int |
vlog_level | ) |
|
|
inlinestatic |
Change the maximum verbosity level for log messages to be output by the default logger.
- Parameters
-
vlog_level | The verbosity level. |
Definition at line 324 of file logging.h.
The documentation for this class was generated from the following file: