8#if (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 202002L))
9#if defined(__has_include)
10#if __has_include(<source_location>)
11#include <source_location>
12#if defined(__cpp_lib_source_location) && (__cpp_lib_source_location >= 201907L)
13#define FLECS_CPP_SOURCE_LOCATION
25#ifdef FLECS_CPP_SOURCE_LOCATION
27 std::source_location loc = std::source_location::current())
29 , file(loc.file_name())
30 , line(
static_cast<int32_t
>(loc.line())) { }
100 ecs_logv_(1, fmt.file, fmt.line, fmt.fmt, args);
111 ecs_logv_(0, fmt.file, fmt.line, fmt.fmt, args);
122 ecs_logv_(-2, fmt.file, fmt.line, fmt.fmt, args);
133 ecs_logv_(-3, fmt.file, fmt.line, fmt.fmt, args);
144 ecs_logv_(0, fmt.file, fmt.line, fmt.fmt, args);
FLECS_API void ecs_logv_(int32_t level, const char *file, int32_t line, const char *fmt, va_list args)
Log at the provided level (va_list).
#define ecs_log_push()
Push log indentation at the default level.
FLECS_API bool ecs_log_enable_colors(bool enabled)
Enable/disable tracing with colors.
FLECS_API int ecs_log_get_level(void)
Get current log level.
#define ecs_log_pop()
Pop log indentation at the default level.
FLECS_API int ecs_log_set_level(int level)
Enable or disable log.
FLECS_API bool ecs_log_enable_timestamp(bool enabled)
Enable/disable logging timestamp.
FLECS_API bool ecs_log_enable_timedelta(bool enabled)
Enable/disable logging time since last log.
void enable_colors(bool enabled=true)
Enable colors in logging.
void enable_timedelta(bool enabled=true)
Enable time delta in logging.
void push()
Increase log indentation.
void set_level(int level)
Set the log level.
void warn(_::fmt_str fmt,...)
Warning (level -2).
void dbg(_::fmt_str fmt,...)
Debug trace (level 1).
int get_level()
Get the log level.
void trace(_::fmt_str fmt,...)
Trace (level 0).
void pop()
Decrease log indentation.
void enable_timestamp(bool enabled=true)
Enable timestamps in logging.
void err(_::fmt_str fmt,...)
Error (level -3).