FERS 0.1.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
logging Namespace Reference

Classes

class  Logger
 Thread-safe logger class for handling logging operations. More...
 

Enumerations

enum class  Level : std::uint8_t {
  TRACE , DEBUG , INFO , WARNING ,
  ERROR , FATAL , OFF
}
 

Functions

std::string getLevelString (const Level level) noexcept
 Converts a log level enum value to its string representation.
 
template<typename... Args>
void log (Level level, const std::source_location &location, const std::string &formatStr, Args &&... args) noexcept
 Logs a formatted message with a specific log level and source location.
 

Variables

Logger logger
 Externally available logger object.
 

Enumeration Type Documentation

◆ Level

enum class logging::Level : std::uint8_t
strong
Enumerator
TRACE 

Trace level for detailed debugging information.

DEBUG 

Debug level for general debugging information.

INFO 

Info level for informational messages.

WARNING 

Warning level for potentially harmful situations.

ERROR 

Error level for error events.

FATAL 

Fatal level for severe error events.

OFF 

Special level to disable all logging.

Definition at line 38 of file logging.h.

39 {
40 TRACE, ///< Trace level for detailed debugging information.
41 DEBUG, ///< Debug level for general debugging information.
42 INFO, ///< Info level for informational messages.
43 WARNING, ///< Warning level for potentially harmful situations.
44 ERROR, ///< Error level for error events.
45 FATAL, ///< Fatal level for severe error events.
46 OFF ///< Special level to disable all logging.
47 };
@ WARNING
Warning level for potentially harmful situations.
@ FATAL
Fatal level for severe error events.
@ TRACE
Trace level for detailed debugging information.
@ INFO
Info level for informational messages.
@ OFF
Special level to disable all logging.
@ ERROR
Error level for error events.
@ DEBUG
Debug level for general debugging information.

Function Documentation

◆ getLevelString()

std::string logging::getLevelString ( const Level  level)
noexcept

Converts a log level enum value to its string representation.

Parameters
levelThe log level.
Returns
A string representing the log level.

Definition at line 144 of file logging.h.

145 {
146 switch (level)
147 {
148 case Level::TRACE:
149 return "TRACE";
150 case Level::DEBUG:
151 return "DEBUG";
152 case Level::INFO:
153 return "INFO";
154 case Level::WARNING:
155 return "WARNING";
156 case Level::ERROR:
157 return "ERROR";
158 case Level::FATAL:
159 return "FATAL";
160 case Level::OFF:
161 return "OFF";
162 default:
163 return "UNKNOWN";
164 }
165 }
math::Vec3 max

References DEBUG, ERROR, FATAL, INFO, OFF, TRACE, and WARNING.

Referenced by logging::Logger::log().

+ Here is the caller graph for this function:

◆ log()

template<typename... Args>
void logging::log ( Level  level,
const std::source_location &  location,
const std::string &  formatStr,
Args &&...  args 
)
noexcept

Logs a formatted message with a specific log level and source location.

Template Parameters
ArgsVariadic template for format arguments.
Parameters
levelThe log level.
locationThe source location of the log call.
formatStrThe format string.
argsThe format arguments.

Definition at line 177 of file logging.h.

178 {
179 logger.log(level, location, formatStr, std::forward<Args>(args)...);
180 }
void log(Level level, const std::string &message, const std::source_location &location=std::source_location::current()) noexcept
Logs a message with a specific log level and source location.
Definition logging.cpp:45
Logger logger
Externally available logger object.
Definition logging.cpp:23

References logging::Logger::log(), and logger.

+ Here is the call graph for this function:

Variable Documentation

◆ logger

Logger logging::logger

Externally available logger object.

Definition at line 23 of file logging.cpp.

Referenced by fers_configure_logging(), fers_get_log_level(), fers_log(), fers_set_log_callback(), and log().