Banjo API 0.0.1
C99 game development API
Loading...
Searching...
No Matches
log.h
Go to the documentation of this file.
1
5
11#ifndef BJ_LOG_H
12#define BJ_LOG_H
13
14#include <banjo/api.h>
15
24#define BJ_MAXIMUM_LOG_LEN 120
25
30enum {
37};
38
56#ifdef BJ_BUILD_RELEASE
57# define bj_log_msg(LEVEL, ...) bj_log_message(BJ_LOG_ ## LEVEL, 0, 0, __VA_ARGS__)
58#else
59# define bj_log_msg(LEVEL, ...) bj_log_message(BJ_LOG_ ## LEVEL, __FILE__, __LINE__, __VA_ARGS__)
60#endif
61
74#define bj_trace(...) bj_log_msg(TRACE, __VA_ARGS__)
75
88#define bj_debug(...) bj_log_msg(DEBUG, __VA_ARGS__)
89
102#define bj_info(...) bj_log_msg(INFO, __VA_ARGS__)
103
116#define bj_warn(...) bj_log_msg(WARN, __VA_ARGS__)
117
130#define bj_err(...) bj_log_msg(ERROR, __VA_ARGS__)
131
144#define bj_fatal(...) bj_log_msg(FATAL, __VA_ARGS__)
145
158
169
175
230BANJO_EXPORT size_t bj_log_message(int level, const char* p_file, int line, const char* p_format, ...);
231
232#endif
General-purpose definitions for Banjo API.
#define BANJO_EXPORT
Definition api.h:139
int bj_get_log_level(void)
Gets the current log level set by bj_set_log_level.
const char * bj_get_log_level_string(int level)
Returns a string describing the given level.
void bj_set_log_level(int level)
Sets the default log level.
size_t bj_log_message(int level, const char *p_file, int line, const char *p_format,...)
Generic message reporting function.
@ BJ_LOG_INFO
Informational messages about execution.
Definition log.h:33
@ BJ_LOG_TRACE
Fine-grained diagnostic details.
Definition log.h:31
@ BJ_LOG_WARN
Warnings for potential issues.
Definition log.h:34
@ BJ_LOG_FATAL
Critical errors leading to termination.
Definition log.h:36
@ BJ_LOG_ERROR
Errors preventing correct function.
Definition log.h:35
@ BJ_LOG_DEBUG
Detailed information for debugging.
Definition log.h:32