4#ifndef TRAM_SDK_FRAMEWORK_LOGGING_H
5#define TRAM_SDK_FRAMEWORK_LOGGING_H
14namespace implementation {
15 template <
typename T>
void concat (
const T& value) {
16 concat<const char*> (
"LOGGER_UNDEFINED_TYPE");
19 template <>
void concat(
const std::string_view& value);
20 template <>
void concat(
const std::string& value);
21 template <>
void concat(
const char*
const& value);
22 template <>
void concat(
const UID& value);
29 template <std::
signed_
integral T>
void concat(
const T& value) {
30 concat_numeric<int64_t>(value);
33 template <std::
unsigned_
integral T>
void concat(
const T& value) {
34 concat_numeric<uint64_t>(value);
37 template <std::
floating_po
int T>
void concat(
const T& value) {
38 concat_numeric<float>(value);
46 inline void log(
void(*flush)(
int,
int),
int severity,
int system, std::string_view& format) {
48 flush(severity, system);
51 template <
typename T,
typename... Args>
52 void log(
void(*flush)(
int,
int),
int severity,
int system, std::string_view& format, T value, Args&&... args) {
56 log(flush, severity, system, format, args...);
72template <
typename... Args>
73void Log(
int severity,
int system,
const std::string_view& format, Args&&... args) {
74 std::string_view format_view = format;
78template <
typename... Args>
79void Log(
int system,
const std::string_view& format, Args&&... args) {
80 std::string_view format_view = format;
84template <
typename... Args>
85void Log(
const std::string_view& format, Args&&... args) {
86 std::string_view format_view = format;
90template <
typename... Args>
91void DisplayLog(
int time,
const std::string_view& format, Args&&... args) {
92 std::string_view format_view = format;
uint32_t system_t
Definition: system.h:11
void flush_console(int severity, int system)
Definition: logging.cpp:49
void concat_fmt(std::string_view &str)
Definition: logging.cpp:37
void concat(const std::string_view &value)
Definition: logging.cpp:84
void flush_callback(int severity, int system)
Definition: logging.cpp:76
void concat_numeric(const int64_t &value)
Definition: logging.cpp:106
void log(void(*flush)(int, int), int severity, int system, std::string_view &format)
Definition: logging.h:46
Severity
Definition: logging.h:60
@ SEVERITY_CRITICAL_ERROR
Definition: logging.h:64
@ SEVERITY_WARNING
Definition: logging.h:62
@ SEVERITY_ERROR
Definition: logging.h:63
@ SEVERITY_INFO
Definition: logging.h:61
@ SEVERITY_DEFAULT
Definition: logging.h:65
void Log(int severity, int system, const std::string_view &format, Args &&... args)
Definition: logging.h:73
void SetLogCallback(void(*callback)(int, const char *))
Definition: logging.cpp:25
void DisplayLog(int time, const std::string_view &format, Args &&... args)
Definition: logging.h:91
void SetSystemLoggingSeverity(System::system_t system, Severity min_severity)
Definition: logging.cpp:15