RADLib
RADical C++ application framework
RADLogging.h File Reference

Async category logging with console, file, rotating file, and syslog sinks. More...

#include <RADCore/RADLicenseGate.h>
#include <cstddef>
#include <memory>
#include <sstream>
#include <string>
+ Include dependency graph for RADLogging.h:

Go to the source code of this file.

Classes

class  RADLogging::Sink
 Logger sink interface. More...
 
class  RADLogging::Logger
 Async process-wide logger. More...
 
class  RADLogging::LogStream
 Streaming log record; emits on destruction. More...
 

Namespaces

 RADLogging
 

Macros

#define RADLOG_TRACE(category)   RADLogging::LogStream(RADLogging::Level::Trace, category)
 Logs with RADLogging at trace level. More...
 
#define RADLOG_DEBUG(category)   RADLogging::LogStream(RADLogging::Level::Debug, category)
 Logs with RADLogging at debug level. More...
 
#define RADLOG_INFO(category)   RADLogging::LogStream(RADLogging::Level::Info, category)
 Logs with RADLogging at info level. More...
 
#define RADLOG_WARNING(category)   RADLogging::LogStream(RADLogging::Level::Warning, category)
 Logs with RADLogging at warning level. More...
 
#define RADLOG_ERROR(category)   RADLogging::LogStream(RADLogging::Level::Error, category)
 Logs with RADLogging at error level. More...
 

Enumerations

enum class  RADLogging::Level {
  RADLogging::Trace = 0 , RADLogging::Debug , RADLogging::Info , RADLogging::Warning ,
  RADLogging::Error , RADLogging::Critical , RADLogging::Off
}
 Log severity. More...
 

Functions

std::shared_ptr< Sink > RADLogging::consoleSink (bool stderrForWarnings=true)
 Creates a console sink. More...
 
std::shared_ptr< Sink > RADLogging::fileSink (const std::string &path)
 Creates a file sink. More...
 
std::shared_ptr< Sink > RADLogging::rotatingFileSink (const std::string &path, size_t maxBytes, size_t maxFiles=3)
 Creates a rotating file sink. More...
 
std::shared_ptr< Sink > RADLogging::syslogSink (std::string ident="RADLib")
 Creates a syslog sink. More...
 
std::string RADLogging::levelName (Level level)
 Formats a level as text. More...
 

Detailed Description

Async category logging with console, file, rotating file, and syslog sinks.

Macro Definition Documentation

◆ RADLOG_DEBUG

#define RADLOG_DEBUG (   category)    RADLogging::LogStream(RADLogging::Level::Debug, category)

Logs with RADLogging at debug level.

◆ RADLOG_ERROR

#define RADLOG_ERROR (   category)    RADLogging::LogStream(RADLogging::Level::Error, category)

Logs with RADLogging at error level.

◆ RADLOG_INFO

#define RADLOG_INFO (   category)    RADLogging::LogStream(RADLogging::Level::Info, category)

Logs with RADLogging at info level.

◆ RADLOG_TRACE

#define RADLOG_TRACE (   category)    RADLogging::LogStream(RADLogging::Level::Trace, category)

Logs with RADLogging at trace level.

◆ RADLOG_WARNING

#define RADLOG_WARNING (   category)    RADLogging::LogStream(RADLogging::Level::Warning, category)

Logs with RADLogging at warning level.