RaidZeroLib
Coroutine robot framework for VEX V5
Loading...
Searching...
No Matches
rz::Log Class Reference

Logging. Messages are stamped with the runtime time and tick number they were logged in. More...

#include <Log.hpp>

Classes

struct  Record

Public Types

enum class  Level { Debug , Info , Warn , Error }
using Output = std::function<void(const Record&)>

Public Member Functions

 Log ()=delete

Static Public Member Functions

template<class... Args>
static void debug (std::format_string< Args... > format, Args &&... args)
template<class... Args>
static void info (std::format_string< Args... > format, Args &&... args)
template<class... Args>
static void warn (std::format_string< Args... > format, Args &&... args)
template<class... Args>
static void error (std::format_string< Args... > format, Args &&... args)
static void setMinimumLevel (Level level) noexcept
 Messages below this level are dropped before they are formatted. Defaults to Info.
static Level minimumLevel () noexcept
static void setOutput (Output output)
 Where records go. Defaults to toStdout; pass [](const Log::Record&) {} to discard.
static void toStdout (const Record &record)
 The default output: prints format(record) to stdout.
static std::string format (const Record &record)
 The standard line for a record, e.g. "[12.340s #1234] warn: message".

Detailed Description

Logging. Messages are stamped with the runtime time and tick number they were logged in.

Member Typedef Documentation

◆ Output

using rz::Log::Output = std::function<void(const Record&)>

Member Enumeration Documentation

◆ Level

enum class rz::Log::Level
strong
Enumerator
Debug 
Info 
Warn 
Error 

Constructor & Destructor Documentation

◆ Log()

rz::Log::Log ( )
delete

Member Function Documentation

◆ debug()

template<class... Args>
void rz::Log::debug ( std::format_string< Args... > format,
Args &&... args )
inlinestatic

◆ error()

template<class... Args>
void rz::Log::error ( std::format_string< Args... > format,
Args &&... args )
inlinestatic

◆ format()

std::string rz::Log::format ( const Record & record)
staticnodiscard

The standard line for a record, e.g. "[12.340s #1234] warn: message".

◆ info()

template<class... Args>
void rz::Log::info ( std::format_string< Args... > format,
Args &&... args )
inlinestatic

◆ minimumLevel()

Level rz::Log::minimumLevel ( )
staticnodiscardnoexcept

◆ setMinimumLevel()

void rz::Log::setMinimumLevel ( Level level)
staticnoexcept

Messages below this level are dropped before they are formatted. Defaults to Info.

◆ setOutput()

void rz::Log::setOutput ( Output output)
static

Where records go. Defaults to toStdout; pass [](const Log::Record&) {} to discard.

◆ toStdout()

void rz::Log::toStdout ( const Record & record)
static

The default output: prints format(record) to stdout.

◆ warn()

template<class... Args>
void rz::Log::warn ( std::format_string< Args... > format,
Args &&... args )
inlinestatic

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