rogue
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
rogue::Logging Class Reference

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.
 

Static Public Member Functions

static std::shared_ptr< rogue::Loggingcreate (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 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.
 

Detailed Description

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.

Definition at line 58 of file Logging.h.

Constructor & Destructor Documentation

◆ Logging()

rogue::Logging::Logging ( const std::string &  name,
bool  quiet = false 
)
explicit

Constructs a logger.

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

Parameters
nameLogger name/category.
quietWhen true, suppresses creation banner output.

Definition at line 65 of file Logging.cpp.

◆ ~Logging()

rogue::Logging::~Logging ( )

Destroys the logger instance.

Definition at line 84 of file Logging.cpp.

Member Function Documentation

◆ create()

rogue::LoggingPtr rogue::Logging::create ( const std::string &  name,
bool  quiet = false 
)
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.

Parameters
nameLogger name/category.
quietWhen true, suppresses creation banner output.
Returns
Shared logger instance.

Definition at line 60 of file Logging.cpp.

◆ critical()

void rogue::Logging::critical ( const char *  fmt,
  ... 
)

Emits a formatted message at Critical level.

Definition at line 123 of file Logging.cpp.

◆ debug()

void rogue::Logging::debug ( const char *  fmt,
  ... 
)

Emits a formatted message at Debug level.

Definition at line 151 of file Logging.cpp.

◆ error()

void rogue::Logging::error ( const char *  fmt,
  ... 
)

Emits a formatted message at Error level.

Definition at line 130 of file Logging.cpp.

◆ info()

void rogue::Logging::info ( const char *  fmt,
  ... 
)

Emits a formatted message at Info level.

Definition at line 144 of file Logging.cpp.

◆ log()

void rogue::Logging::log ( uint32_t  level,
const char *  fmt,
  ... 
)

Emits a formatted log message at a specified level.

Parameters
levelSeverity level.
fmtprintf-style format string.

Definition at line 116 of file Logging.cpp.

◆ logThreadId()

void rogue::Logging::logThreadId ( )

Emits the current thread id through this logger.

Definition at line 158 of file Logging.cpp.

◆ setFilter()

void rogue::Logging::setFilter ( const std::string &  filter,
uint32_t  level 
)
static

Sets name-based filter level override.

Parameters
filterLogger-name prefix to match.
levelLevel threshold for matching names.

Definition at line 92 of file Logging.cpp.

◆ setLevel()

void rogue::Logging::setLevel ( uint32_t  level)
static

Sets the global default logging level.

Parameters
levelNew global level threshold.

Definition at line 86 of file Logging.cpp.

◆ setup_python()

void rogue::Logging::setup_python ( )
static

Registers Python bindings for Logging.

Definition at line 174 of file Logging.cpp.

◆ warning()

void rogue::Logging::warning ( const char *  fmt,
  ... 
)

Emits a formatted message at Warning level.

Definition at line 137 of file Logging.cpp.

Member Data Documentation

◆ Critical

const uint32_t rogue::Logging::Critical = 50
static

Critical severity level constant.


Company : SLAC National Accelerator Laboratory

Description:

Logging interface for pyrogue

This file is part of the rogue software platform. It is subject to the license terms in the LICENSE.txt file found in the top-level directory of this distribution and at: https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part of the rogue software platform, including this file, may be copied, modified, propagated, or distributed except according to the terms

contained in the LICENSE.txt file.

Definition at line 78 of file Logging.h.

◆ Debug

const uint32_t rogue::Logging::Debug = 10
static

Debug severity level constant.

Definition at line 88 of file Logging.h.

◆ Error

const uint32_t rogue::Logging::Error = 40
static

Error severity level constant.

Definition at line 80 of file Logging.h.

◆ Info

const uint32_t rogue::Logging::Info = 20
static

Informational severity level constant.

Definition at line 86 of file Logging.h.

◆ Thread

const uint32_t rogue::Logging::Thread = 35
static

Thread-trace severity level constant.

Definition at line 82 of file Logging.h.

◆ Warning

const uint32_t rogue::Logging::Warning = 30
static

Warning severity level constant.

Definition at line 84 of file Logging.h.


The documentation for this class was generated from the following files: