Agents 1.4.0
Edge AI Agents SDK
Loading...
Searching...
No Matches
agents::Logger Class Reference

Logger utility class that wraps spdlog functionality. More...

#include <logger.h>

Public Types

enum class  Level {
  TRACE ,
  DEBUG ,
  INFO ,
  WARN ,
  ERR ,
  CRITICAL ,
  OFF
}
 The log level. More...

Static Public Member Functions

static void init (Level level=Level::INFO)
 Initialize the logger.
static void setLevel (Level level)
 Set the log level.
static spdlog::level::level_enum toSpdlogLevel (Level level)
 Convert Level enum to spdlog level.
template<typename... Args>
static void trace (fmt::format_string< Args... > fmt, Args &&... args)
 Log a message at trace level.
template<typename... Args>
static void debug (fmt::format_string< Args... > fmt, Args &&... args)
 Log a message at debug level.
template<typename... Args>
static void info (fmt::format_string< Args... > fmt, Args &&... args)
 Log a message at info level.
template<typename... Args>
static void warn (fmt::format_string< Args... > fmt, Args &&... args)
 Log a message at warn level.
template<typename... Args>
static void error (fmt::format_string< Args... > fmt, Args &&... args)
 Log a message at error level.
template<typename... Args>
static void critical (fmt::format_string< Args... > fmt, Args &&... args)
 Log a message at critical level.

Detailed Description

Logger utility class that wraps spdlog functionality.

Member Enumeration Documentation

◆ Level

enum class agents::Logger::Level
strong

The log level.

Enumerator
TRACE 

Trace logging level.

DEBUG 

Debug logging level.

INFO 

Info logging level.

WARN 

Warning logging level.

ERR 

Error logging level.

CRITICAL 

Critical logging level.

OFF 

Logging disabled level.

Member Function Documentation

◆ critical()

template<typename... Args>
void agents::Logger::critical ( fmt::format_string< Args... > fmt,
Args &&... args )
inlinestatic

Log a message at critical level.

Parameters
fmtThe format string
argsThe arguments

◆ debug()

template<typename... Args>
void agents::Logger::debug ( fmt::format_string< Args... > fmt,
Args &&... args )
inlinestatic

Log a message at debug level.

Parameters
fmtThe format string
argsThe arguments
Examples
prompt_chain_example.cpp, and routing_example.cpp.

◆ error()

template<typename... Args>
void agents::Logger::error ( fmt::format_string< Args... > fmt,
Args &&... args )
inlinestatic

◆ info()

template<typename... Args>
void agents::Logger::info ( fmt::format_string< Args... > fmt,
Args &&... args )
inlinestatic

◆ init()

◆ setLevel()

void agents::Logger::setLevel ( Level level)
static

Set the log level.

Parameters
levelThe log level
Examples
actor_agent_example.cpp.

◆ toSpdlogLevel()

spdlog::level::level_enum agents::Logger::toSpdlogLevel ( Level level)
static

Convert Level enum to spdlog level.

Parameters
levelThe log level
Returns
The spdlog level

◆ trace()

template<typename... Args>
void agents::Logger::trace ( fmt::format_string< Args... > fmt,
Args &&... args )
inlinestatic

Log a message at trace level.

Parameters
fmtThe format string
argsThe arguments

◆ warn()

template<typename... Args>
void agents::Logger::warn ( fmt::format_string< Args... > fmt,
Args &&... args )
inlinestatic

Log a message at warn level.

Parameters
fmtThe format string
argsThe arguments