Foundation
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
Logging.hpp File Reference
#include <cstdio>
#include <chrono>
#include <string_view>
#include <fmt/format.h>
#include <fmt/chrono.h>

Go to the source code of this file.

Macros

#define LOG(TAG, LEVEL, FORMAT, ...)   Foundation_Log(#TAG, LEVEL, FORMAT __VA_OPT__(,) __VA_ARGS__);
 
#define CHECK(expr)
 
#define CHECK_MSG(expr, format_str, ...)
 

Enumerations

enum  LogLevel { LogDebug , LogInfo , LogWarn , LogError }
 

Functions

constexpr const char * format_as (LogLevel level)
 
void Foundation_LogImpl (LogLevel level, const char *tag, std::string_view formatted)
 
template<typename ... Args>
void Foundation_Log (const char *tag, LogLevel level, fmt::format_string< Args... > format, Args &&... args)
 

Macro Definition Documentation

◆ CHECK

#define CHECK (   expr)
Value:
if(!(expr)) { \
LOG(Core, LogError, "Check failed: " #expr); \
throw std::runtime_error( #expr ); \
}
@ LogError
Definition Logging.hpp:13

◆ CHECK_MSG

#define CHECK_MSG (   expr,
  format_str,
  ... 
)
Value:
if(!(expr)) { \
LOG(Core, LogError, format_str __VA_OPT__(,) __VA_ARGS__); \
throw std::runtime_error( #expr ); \
}

◆ LOG

#define LOG (   TAG,
  LEVEL,
  FORMAT,
  ... 
)    Foundation_Log(#TAG, LEVEL, FORMAT __VA_OPT__(,) __VA_ARGS__);

Enumeration Type Documentation

◆ LogLevel

enum LogLevel
Enumerator
LogDebug 
LogInfo 
LogWarn 
LogError 

Function Documentation

◆ format_as()

constexpr const char * format_as ( LogLevel  level)
constexpr

◆ Foundation_Log()

template<typename ... Args>
void Foundation_Log ( const char *  tag,
LogLevel  level,
fmt::format_string< Args... >  format,
Args &&...  args 
)

◆ Foundation_LogImpl()

void Foundation_LogImpl ( LogLevel  level,
const char *  tag,
std::string_view  formatted 
)
extern