rogue::Logging

Python binding

This C++ class is also exported into Python as rogue.Logging.

Python API page: - rogue.Logging

For conceptual usage, see:

class Logging
[header]

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.

Public Functions

explicit Logging(const std::string &name, bool quiet = false)
[header] [impl]

Constructs a logger.

This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.

Parameters:
  • name – Logger name/category.

  • quiet – When true, suppresses creation banner output.

~Logging()
[header] [impl]

Destroys the logger instance.

void log(uint32_t level, const char *fmt, ...)
[header] [impl]

Emits a formatted log message at a specified level.

Parameters:
  • level – Severity level.

  • fmtprintf-style format string.

void critical(const char *fmt, ...)
[header] [impl]

Emits a formatted message at Critical level.

void error(const char *fmt, ...)
[header] [impl]

Emits a formatted message at Error level.

void warning(const char *fmt, ...)
[header] [impl]

Emits a formatted message at Warning level.

void info(const char *fmt, ...)
[header] [impl]

Emits a formatted message at Info level.

void debug(const char *fmt, ...)
[header] [impl]

Emits a formatted message at Debug level.

void logThreadId()
[header] [impl]

Emits the current thread id through this logger.

const std::string &name() const
[header] [impl]

Returns the fully-qualified emitted logger name.

Public Static Functions

static std::shared_ptr<rogue::Logging> create(const std::string &name, bool quiet = false)
[header] [impl]

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.

Parameters:
  • name – Logger name/category.

  • quiet – When true, suppresses creation banner output.

Returns:

Shared logger instance.

static void setLevel(uint32_t level)
[header] [impl]

Sets the global default logging level.

Parameters:

level – New global level threshold.

static void setFilter(const std::string &filter, uint32_t level)
[header] [impl]

Sets name-based filter level override.

Parameters:
  • filter – Logger-name prefix to match.

  • level – Level threshold for matching names.

static void setForwardPython(bool enable)
[header] [impl]

Enables or disables forwarding Rogue C++ logs into Python logging.

Parameters:

enable – When true, emitted C++ log messages are also sent to the Python logging logger with the same fully-qualified name.

static bool forwardPython()
[header] [impl]

Returns whether Rogue C++ logs are currently forwarded to Python logging.

static void setEmitStdout(bool enable)
[header] [impl]

Enables or disables direct stdout emission of Rogue C++ logs.

Parameters:

enable – When false, Rogue C++ logs are not printed directly by the native logger sink.

static bool emitStdout()
[header] [impl]

Returns whether Rogue C++ logs are currently emitted to stdout.

static std::string normalizeName(const std::string &name)
[header] [impl]

Normalizes logger names to the emitted Rogue namespace.

Parameters:

name – Logger name or prefix.

Returns:

Name prefixed with pyrogue. when required.

static void setup_python()
[header] [impl]

Registers Python bindings for Logging.

Public Static Attributes

static const uint32_t Critical = 50
[header]

Critical severity level constant.

static const uint32_t Error = 40
[header]

Error severity level constant.

static const uint32_t Thread = 35
[header]

Thread-trace severity level constant.

static const uint32_t Warning = 30
[header]

Warning severity level constant.

static const uint32_t Info = 20
[header]

Informational severity level constant.

static const uint32_t Debug = 10
[header]

Debug severity level constant.