Agents 0.0.2
Edge AI Agents SDK
Loading...
Searching...
No Matches
Logger Class Reference

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

#include <logger.h>

Public Types

enum class  Level {
  TRACE ,
  DEBUG ,
  INFO ,
  WARN ,
  ERROR ,
  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.

ERROR 

Error logging level.

CRITICAL 

Critical logging level.

OFF 

Logging disabled level.

Member Function Documentation

◆ critical()

template<typename... Args>
static 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>
static void agents::Logger::debug ( fmt::format_string< Args... > fmt,
Args &&... args )
inlinestatic

Log a message at debug level.

Parameters
fmtThe format string
argsThe arguments

◆ error()

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

Log a message at error level.

Parameters
fmtThe format string
argsThe arguments
Examples
actor_agent_example.cpp, autonomous_agent_example.cpp, coroutine_example.cpp, prompt_chain_example.cpp, routing_example.cpp, and simple_agent.cpp.

◆ info()

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

Log a message at info level.

Parameters
fmtThe format string
argsThe arguments
Examples
autonomous_agent_example.cpp, coroutine_example.cpp, prompt_chain_example.cpp, routing_example.cpp, simple_agent.cpp, and simple_workflow.cpp.

◆ init()

static void agents::Logger::init ( Level level = Level::INFO)
static

◆ setLevel()

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

Set the log level.

Parameters
levelThe log level
Examples
actor_agent_example.cpp.

◆ toSpdlogLevel()

static 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>
static 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>
static void agents::Logger::warn ( fmt::format_string< Args... > fmt,
Args &&... args )
inlinestatic

Log a message at warn level.

Parameters
fmtThe format string
argsThe arguments
Examples
simple_workflow.cpp.