Flecs v3.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
log.hpp
Go to the documentation of this file.
1
6#pragma once
7
8namespace flecs {
9namespace log {
10
20inline void set_level(int level) {
21 ecs_log_set_level(level);
22}
23
25inline void enable_colors(bool enabled = true) {
26 ecs_log_enable_colors(enabled);
27}
28
30inline void enable_timestamp(bool enabled = true) {
32}
33
35inline void enable_timedelta(bool enabled = true) {
37}
38
40inline void dbg(const char *fmt, ...) {
41 va_list args;
42 va_start(args, fmt);
43 ecs_logv(1, fmt, args);
44 va_end(args);
45}
46
48inline void trace(const char *fmt, ...) {
49 va_list args;
50 va_start(args, fmt);
51 ecs_logv(0, fmt, args);
52 va_end(args);
53}
54
56inline void warn(const char *fmt, ...) {
57 va_list args;
58 va_start(args, fmt);
59 ecs_logv(-2, fmt, args);
60 va_end(args);
61}
62
64inline void err(const char *fmt, ...) {
65 va_list args;
66 va_start(args, fmt);
67 ecs_logv(-3, fmt, args);
68 va_end(args);
69}
70
72inline void push(const char *fmt, ...) {
73 va_list args;
74 va_start(args, fmt);
75 ecs_logv(0, fmt, args);
76 va_end(args);
77 ecs_log_push();
78}
79
81inline void push() {
82 ecs_log_push();
83}
84
86inline void pop() {
87 ecs_log_pop();
88}
89
92}
93}
FLECS_API bool ecs_log_enable_colors(bool enabled)
Enable/disable tracing with colors.
FLECS_API int ecs_log_set_level(int level)
Enable or disable tracing.
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.
Definition: log.hpp:25
void enable_timedelta(bool enabled=true)
Enable time delta in logging.
Definition: log.hpp:35
void push()
Increase log indentation.
Definition: log.hpp:81
void set_level(int level)
Set log level.
Definition: log.hpp:20
void trace(const char *fmt,...)
Trace (level 0)
Definition: log.hpp:48
void err(const char *fmt,...)
Trace (level -3)
Definition: log.hpp:64
void warn(const char *fmt,...)
Trace (level -2)
Definition: log.hpp:56
void pop()
Increase log indentation.
Definition: log.hpp:86
void enable_timestamp(bool enabled=true)
Enable timestamps in logging.
Definition: log.hpp:30
void dbg(const char *fmt,...)
Debug trace (level 1)
Definition: log.hpp:40