|
rogue
|
Structured Rogue logging helper. More...
#include <Logging.h>
Public Member Functions | |
| Logging (const std::string &name, bool quiet=false) | |
| Constructs a logger. | |
| ~Logging () | |
| Destroys the logger instance. | |
| void | log (uint32_t level, const char *fmt,...) |
| Emits a formatted log message at a specified level. | |
| void | critical (const char *fmt,...) |
Emits a formatted message at Critical level. | |
| void | error (const char *fmt,...) |
Emits a formatted message at Error level. | |
| void | warning (const char *fmt,...) |
Emits a formatted message at Warning level. | |
| void | info (const char *fmt,...) |
Emits a formatted message at Info level. | |
| void | debug (const char *fmt,...) |
Emits a formatted message at Debug level. | |
| void | logThreadId () |
| Emits the current thread id through this logger. | |
| const std::string & | name () const |
| Returns the fully-qualified emitted logger name. | |
Static Public Member Functions | |
| static std::shared_ptr< rogue::Logging > | create (const std::string &name, bool quiet=false) |
| Creates a logger instance. | |
| static void | setLevel (uint32_t level) |
| Sets the global default logging level. | |
| static void | setFilter (const std::string &filter, uint32_t level) |
| Sets name-based filter level override. | |
| static void | setForwardPython (bool enable) |
| Enables or disables forwarding Rogue C++ logs into Python logging. | |
| static bool | forwardPython () |
| Returns whether Rogue C++ logs are currently forwarded to Python logging. | |
| static void | setEmitStdout (bool enable) |
| Enables or disables direct stdout emission of Rogue C++ logs. | |
| static bool | emitStdout () |
| Returns whether Rogue C++ logs are currently emitted to stdout. | |
| static std::string | normalizeName (const std::string &name) |
| Normalizes logger names to the emitted Rogue namespace. | |
| static void | setup_python () |
Registers Python bindings for Logging. | |
Static Public Attributes | |
| static const uint32_t | Critical = 50 |
| Critical severity level constant. | |
| static const uint32_t | Error = 40 |
| Error severity level constant. | |
| static const uint32_t | Thread = 35 |
| Thread-trace severity level constant. | |
| static const uint32_t | Warning = 30 |
| Warning severity level constant. | |
| static const uint32_t | Info = 20 |
| Informational severity level constant. | |
| static const uint32_t | Debug = 10 |
| Debug severity level constant. | |
Structured Rogue logging helper.
Provides leveled logging with global level control and optional name-based filters. Instances are typically created per class/module and reused.
|
explicit |
Constructs a logger.
This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.
| name | Logger name/category. |
| quiet | When true, suppresses creation banner output. |
Definition at line 106 of file Logging.cpp.
| rogue::Logging::~Logging | ( | ) |
Destroys the logger instance.
Definition at line 117 of file Logging.cpp.
|
static |
Creates a logger instance.
Parameter semantics are identical to the constructor; see Logging() for logger initialization details. This static factory is the preferred construction path when the object is shared across Rogue graph connections or exposed to Python. It returns std::shared_ptr ownership compatible with Rogue pointer typedefs.
| name | Logger name/category. |
| quiet | When true, suppresses creation banner output. |
Definition at line 95 of file Logging.cpp.
| void rogue::Logging::critical | ( | const char * | fmt, |
| ... | |||
| ) |
Emits a formatted message at Critical level.
Definition at line 266 of file Logging.cpp.
| void rogue::Logging::debug | ( | const char * | fmt, |
| ... | |||
| ) |
Emits a formatted message at Debug level.
Definition at line 294 of file Logging.cpp.
|
static |
Returns whether Rogue C++ logs are currently emitted to stdout.
Definition at line 186 of file Logging.cpp.
| void rogue::Logging::error | ( | const char * | fmt, |
| ... | |||
| ) |
Emits a formatted message at Error level.
Definition at line 273 of file Logging.cpp.
|
static |
Returns whether Rogue C++ logs are currently forwarded to Python logging.
Definition at line 172 of file Logging.cpp.
| void rogue::Logging::info | ( | const char * | fmt, |
| ... | |||
| ) |
Emits a formatted message at Info level.
Definition at line 287 of file Logging.cpp.
| void rogue::Logging::log | ( | uint32_t | level, |
| const char * | fmt, | ||
| ... | |||
| ) |
Emits a formatted log message at a specified level.
| level | Severity level. |
| fmt | printf-style format string. |
Definition at line 259 of file Logging.cpp.
| void rogue::Logging::logThreadId | ( | ) |
Emits the current thread id through this logger.
Definition at line 301 of file Logging.cpp.
| const std::string & rogue::Logging::name | ( | ) | const |
Returns the fully-qualified emitted logger name.
Definition at line 306 of file Logging.cpp.
|
static |
Normalizes logger names to the emitted Rogue namespace.
| name | Logger name or prefix. |
pyrogue. when required. Definition at line 100 of file Logging.cpp.
|
static |
Enables or disables direct stdout emission of Rogue C++ logs.
| enable | When false, Rogue C++ logs are not printed directly by the native logger sink. |
Definition at line 180 of file Logging.cpp.
|
static |
Sets name-based filter level override.
| filter | Logger-name prefix to match. |
| level | Level threshold for matching names. |
Definition at line 152 of file Logging.cpp.
|
static |
Enables or disables forwarding Rogue C++ logs into Python logging.
| enable | When true, emitted C++ log messages are also sent to the Python logging logger with the same fully-qualified name. |
Definition at line 166 of file Logging.cpp.
|
static |
Sets the global default logging level.
| level | New global level threshold. |
Definition at line 143 of file Logging.cpp.
|
static |
Registers Python bindings for Logging.
Definition at line 310 of file Logging.cpp.
| void rogue::Logging::warning | ( | const char * | fmt, |
| ... | |||
| ) |
Emits a formatted message at Warning level.
Definition at line 280 of file Logging.cpp.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |