opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
log.h
Go to the documentation of this file.
1#pragma once
2
9
10#include <cstddef>
11#include <memory>
12
13// log: logging implementation
14//
15// this implementation takes heavy inspiration from `spdlog`
16
17namespace osc
18{
19 // global logging API
20 std::shared_ptr<Logger> global_default_logger();
22
24 {
26 }
27
28 template<typename... Args>
29 inline void log_message(LogLevel level, CStringView fmt, const Args&... args)
30 {
32 }
33
34 template<typename... Args>
39
40 template<typename... Args>
45
46 template<typename... Args>
51
52 template<typename... Args>
57
58 template<typename... Args>
63
64 template<typename... Args>
69
70 namespace detail
71 {
72 static constexpr size_t c_max_log_traceback_messages = 512;
73 }
74
78}
Definition c_string_view.h:12
Definition logger.h:20
void log_message(LogLevel log_level, CStringView fmt,...)
Formats fmt with std::vsnprintf and then logs the formatted message with level log_level.
Definition logger.h:32
LogLevel level() const
Definition logger.h:75
Definition synchronized_value.h:18
Definition custom_decoration_generator.h:5
void log_error(CStringView fmt, const Args &... args)
Definition log.h:59
void log_trace(CStringView fmt, const Args &... args)
Definition log.h:35
void log_critical(CStringView fmt, const Args &... args)
Definition log.h:65
LogLevel log_level()
Definition log.h:23
LogLevel
Definition log_level.h:11
void log_debug(CStringView fmt, const Args &... args)
Definition log.h:41
void log_warn(CStringView fmt, const Args &... args)
Definition log.h:53
SynchronizedValue< CircularBuffer< LogMessage, detail::c_max_log_traceback_messages > > & global_get_traceback_log()
LogLevel global_get_traceback_level()
constexpr U to(T &&value)
Definition conversion.h:56
void log_message(LogLevel level, CStringView fmt, const Args &... args)
Definition log.h:29
std::shared_ptr< Logger > global_default_logger()
Logger * global_default_logger_raw()
void log_info(CStringView fmt, const Args &... args)
Definition log.h:47
void global_set_traceback_level(LogLevel)