|
#define | ecs_print(level, ...) _ecs_print(level, __FILE__, __LINE__, __VA_ARGS__) |
|
#define | ecs_printv(level, fmt, args) _ecs_printv(level, __FILE__, __LINE__, fmt, args) |
|
#define | ecs_log(level, ...) _ecs_log(level, __FILE__, __LINE__, __VA_ARGS__) |
|
#define | ecs_logv(level, fmt, args) _ecs_logv(level, __FILE__, __LINE__, fmt, args) |
|
#define | _ecs_trace(file, line, ...) _ecs_log(0, file, line, __VA_ARGS__) |
|
#define | ecs_trace(...) _ecs_trace(__FILE__, __LINE__, __VA_ARGS__) |
|
#define | _ecs_warn(file, line, ...) _ecs_log(-2, file, line, __VA_ARGS__) |
|
#define | ecs_warn(...) _ecs_warn(__FILE__, __LINE__, __VA_ARGS__) |
|
#define | _ecs_err(file, line, ...) _ecs_log(-3, file, line, __VA_ARGS__) |
|
#define | ecs_err(...) _ecs_err(__FILE__, __LINE__, __VA_ARGS__) |
|
#define | _ecs_fatal(file, line, ...) _ecs_log(-4, file, line, __VA_ARGS__) |
|
#define | ecs_fatal(...) _ecs_fatal(__FILE__, __LINE__, __VA_ARGS__) |
|
#define | ecs_deprecated(...) _ecs_deprecated(__FILE__, __LINE__, __VA_ARGS__) |
|
#define | FLECS_LOG_3 /* Enable all tracing in debug mode. May slow things down */ |
|
#define | ecs_dbg_1(...) ecs_log(1, __VA_ARGS__); |
|
#define | ecs_dbg_2(...) ecs_log(2, __VA_ARGS__); |
|
#define | ecs_dbg_3(...) ecs_log(3, __VA_ARGS__); |
|
#define | ecs_log_push_1() _ecs_log_push(1); |
|
#define | ecs_log_push_2() _ecs_log_push(2); |
|
#define | ecs_log_push_3() _ecs_log_push(3); |
|
#define | ecs_log_pop_1() _ecs_log_pop(1); |
|
#define | ecs_log_pop_2() _ecs_log_pop(2); |
|
#define | ecs_log_pop_3() _ecs_log_pop(3); |
|
#define | ecs_should_log_1() ecs_should_log(1) |
|
#define | ecs_should_log_2() ecs_should_log(2) |
|
#define | ecs_should_log_3() ecs_should_log(3) |
|
#define | FLECS_LOG_2 |
|
#define | FLECS_LOG_1 |
|
#define | FLECS_LOG_0 |
|
#define | ecs_dbg ecs_dbg_1 |
|
#define | ecs_log_push() _ecs_log_push(0) |
|
#define | ecs_log_pop() _ecs_log_pop(0) |
|
#define | ecs_abort(error_code, ...) |
| Abort. More...
|
|
#define | ecs_assert(condition, error_code, ...) |
| Assert. More...
|
|
#define | ecs_assert_var(var, error_code, ...) |
|
#define | ecs_dbg_assert(condition, error_code, ...) ecs_assert(condition, error_code, __VA_ARGS__) |
| Debug assert. More...
|
|
#define | ecs_dummy_check |
|
#define | ecs_check(condition, error_code, ...) |
| Check. More...
|
|
#define | ecs_throw(error_code, ...) |
| Panic. More...
|
|
#define | ecs_parser_error(name, expr, column, ...) _ecs_parser_error(name, expr, column, __VA_ARGS__) |
| Parser error. More...
|
|
#define | ecs_parser_errorv(name, expr, column, fmt, args) _ecs_parser_errorv(name, expr, column, fmt, args) |
|
#define | ECS_INVALID_OPERATION (1) |
|
#define | ECS_INVALID_PARAMETER (2) |
|
#define | ECS_CONSTRAINT_VIOLATED (3) |
|
#define | ECS_OUT_OF_MEMORY (4) |
|
#define | ECS_OUT_OF_RANGE (5) |
|
#define | ECS_UNSUPPORTED (6) |
|
#define | ECS_INTERNAL_ERROR (7) |
|
#define | ECS_ALREADY_DEFINED (8) |
|
#define | ECS_MISSING_OS_API (9) |
|
#define | ECS_OPERATION_FAILED (10) |
|
#define | ECS_INVALID_CONVERSION (11) |
|
#define | ECS_ID_IN_USE (12) |
|
#define | ECS_CYCLE_DETECTED (13) |
|
#define | ECS_LEAK_DETECTED (14) |
|
#define | ECS_INCONSISTENT_NAME (20) |
|
#define | ECS_NAME_IN_USE (21) |
|
#define | ECS_NOT_A_COMPONENT (22) |
|
#define | ECS_INVALID_COMPONENT_SIZE (23) |
|
#define | ECS_INVALID_COMPONENT_ALIGNMENT (24) |
|
#define | ECS_COMPONENT_NOT_REGISTERED (25) |
|
#define | ECS_INCONSISTENT_COMPONENT_ID (26) |
|
#define | ECS_INCONSISTENT_COMPONENT_ACTION (27) |
|
#define | ECS_MODULE_UNDEFINED (28) |
|
#define | ECS_MISSING_SYMBOL (29) |
|
#define | ECS_ALREADY_IN_USE (30) |
|
#define | ECS_ACCESS_VIOLATION (40) |
|
#define | ECS_COLUMN_INDEX_OUT_OF_RANGE (41) |
|
#define | ECS_COLUMN_IS_NOT_SHARED (42) |
|
#define | ECS_COLUMN_IS_SHARED (43) |
|
#define | ECS_COLUMN_TYPE_MISMATCH (45) |
|
#define | ECS_INVALID_WHILE_READONLY (70) |
|
#define | ECS_LOCKED_STORAGE (71) |
|
#define | ECS_INVALID_FROM_WORKER (72) |
|
#define | ECS_BLACK "\033[1;30m" |
|
#define | ECS_RED "\033[0;31m" |
|
#define | ECS_GREEN "\033[0;32m" |
|
#define | ECS_YELLOW "\033[0;33m" |
|
#define | ECS_BLUE "\033[0;34m" |
|
#define | ECS_MAGENTA "\033[0;35m" |
|
#define | ECS_CYAN "\033[0;36m" |
|
#define | ECS_WHITE "\033[1;37m" |
|
#define | ECS_GREY "\033[0;37m" |
|
#define | ECS_NORMAL "\033[0;49m" |
|
#define | ECS_BOLD "\033[1;49m" |
|
|
FLECS_API void | _ecs_deprecated (const char *file, int32_t line, const char *msg) |
|
FLECS_API void | _ecs_log_push (int32_t level) |
| Increase log stack. More...
|
|
FLECS_API void | _ecs_log_pop (int32_t level) |
| Decrease log stack. More...
|
|
FLECS_API bool | ecs_should_log (int32_t level) |
| Should current level be logged. More...
|
|
FLECS_API const char * | ecs_strerror (int32_t error_code) |
| Get description for error code.
|
|
FLECS_API void | _ecs_print (int32_t level, const char *file, int32_t line, const char *fmt,...) |
|
FLECS_API void | _ecs_printv (int level, const char *file, int32_t line, const char *fmt, va_list args) |
|
FLECS_API void | _ecs_log (int32_t level, const char *file, int32_t line, const char *fmt,...) |
|
FLECS_API void | _ecs_logv (int level, const char *file, int32_t line, const char *fmt, va_list args) |
|
FLECS_API void | _ecs_abort (int32_t error_code, const char *file, int32_t line, const char *fmt,...) |
|
FLECS_API bool | _ecs_assert (bool condition, int32_t error_code, const char *condition_str, const char *file, int32_t line, const char *fmt,...) |
|
FLECS_API void | _ecs_parser_error (const char *name, const char *expr, int64_t column, const char *fmt,...) |
|
FLECS_API void | _ecs_parser_errorv (const char *name, const char *expr, int64_t column, const char *fmt, va_list args) |
|
FLECS_API int | ecs_log_set_level (int level) |
| Enable or disable log. More...
|
|
FLECS_API int | ecs_log_get_level (void) |
| Get current log level. More...
|
|
FLECS_API bool | ecs_log_enable_colors (bool enabled) |
| Enable/disable tracing with colors. More...
|
|
FLECS_API bool | ecs_log_enable_timestamp (bool enabled) |
| Enable/disable logging timestamp. More...
|
|
FLECS_API bool | ecs_log_enable_timedelta (bool enabled) |
| Enable/disable logging time since last log. More...
|
|
FLECS_API int | ecs_log_last_error (void) |
| Get last logged error code. More...
|
|
Logging functions.
FLECS_API int ecs_log_set_level |
( |
int |
level | ) |
|
Enable or disable log.
This will enable builtin log. For log to work, it will have to be compiled in which requires defining one of the following macros:
FLECS_LOG_0 - All log is disabled FLECS_LOG_1 - Enable log level 1 FLECS_LOG_2 - Enable log level 2 and below FLECS_LOG_3 - Enable log level 3 and below
If no log level is defined and this is a debug build, FLECS_LOG_3 will have been automatically defined.
The provided level corresponds with the log level. If -1 is provided as value, warnings are disabled. If -2 is provided, errors are disabled as well.
- Parameters
-
level | Desired tracing level. |
- Returns
- Previous log level.