Flecs v4.0
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches

Logging functions. More...

Collaboration diagram for Log:

Macros

#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.
 
#define ecs_assert(condition, error_code, ...)
 Assert.
 
#define ecs_assert_var(var, error_code, ...)
 
#define ecs_dbg_assert(condition, error_code, ...)   ecs_assert(condition, error_code, __VA_ARGS__)
 Debug assert.
 
#define ecs_san_assert(condition, error_code, ...)
 Sanitize assert.
 
#define ecs_dummy_check
 
#define ecs_check(condition, error_code, ...)
 Check.
 
#define ecs_throw(error_code, ...)
 Panic.
 
#define ecs_parser_error(name, expr, column, ...)    ecs_parser_error_(name, expr, column, __VA_ARGS__)
 Parser error.
 
#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_DOUBLE_FREE   (15)
 
#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"
 

Functions

FLECS_API void ecs_deprecated_ (const char *file, int32_t line, const char *msg)
 Log message indicating an operation is deprecated.
 
FLECS_API void ecs_log_push_ (int32_t level)
 Increase log stack.
 
FLECS_API void ecs_log_pop_ (int32_t level)
 Decrease log stack.
 
FLECS_API bool ecs_should_log (int32_t level)
 Should current level be logged.
 
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 void ecs_assert_log_ (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.
 
FLECS_API int ecs_log_get_level (void)
 Get current log level.
 
FLECS_API bool ecs_log_enable_colors (bool enabled)
 Enable/disable tracing with colors.
 
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.
 
FLECS_API int ecs_log_last_error (void)
 Get last logged error code.
 

Detailed Description

Logging functions.

Macro Definition Documentation

◆ ecs_abort

#define ecs_abort ( error_code,
... )
Value:
ecs_abort_(error_code, __FILE__, __LINE__, __VA_ARGS__);\
ecs_os_abort(); abort(); /* satisfy compiler/static analyzers */

Abort.

Unconditionally aborts process.

Definition at line 343 of file log.h.

◆ ECS_ACCESS_VIOLATION

#define ECS_ACCESS_VIOLATION   (40)

Definition at line 543 of file log.h.

◆ ECS_ALREADY_DEFINED

#define ECS_ALREADY_DEFINED   (8)

Definition at line 522 of file log.h.

◆ ECS_ALREADY_IN_USE

#define ECS_ALREADY_IN_USE   (30)

Definition at line 541 of file log.h.

◆ ecs_assert

#define ecs_assert ( condition,
error_code,
... )
Value:
if (!(condition)) {\
ecs_assert_log_(error_code, #condition, __FILE__, __LINE__, __VA_ARGS__);\
ecs_os_abort();\
}\
assert(condition) /* satisfy compiler/static analyzers */

Assert.

Aborts if condition is false, disabled in debug mode.

Definition at line 352 of file log.h.

◆ ecs_assert_var

#define ecs_assert_var ( var,
error_code,
... )
Value:
ecs_assert(var, error_code, __VA_ARGS__);\
(void)var
#define ecs_assert(condition, error_code,...)
Assert.
Definition log.h:352

Definition at line 360 of file log.h.

◆ ECS_BLACK

#define ECS_BLACK   "\033[1;30m"

Definition at line 558 of file log.h.

◆ ECS_BLUE

#define ECS_BLUE   "\033[0;34m"

Definition at line 562 of file log.h.

◆ ECS_BOLD

#define ECS_BOLD   "\033[1;49m"

Definition at line 568 of file log.h.

◆ ecs_check

#define ecs_check ( condition,
error_code,
... )
Value:
ecs_assert(condition, error_code, __VA_ARGS__);\
ecs_dummy_check

Check.

goto error if condition is false.

Definition at line 399 of file log.h.

◆ ECS_COLUMN_INDEX_OUT_OF_RANGE

#define ECS_COLUMN_INDEX_OUT_OF_RANGE   (41)

Definition at line 544 of file log.h.

◆ ECS_COLUMN_IS_NOT_SHARED

#define ECS_COLUMN_IS_NOT_SHARED   (42)

Definition at line 545 of file log.h.

◆ ECS_COLUMN_IS_SHARED

#define ECS_COLUMN_IS_SHARED   (43)

Definition at line 546 of file log.h.

◆ ECS_COLUMN_TYPE_MISMATCH

#define ECS_COLUMN_TYPE_MISMATCH   (45)

Definition at line 547 of file log.h.

◆ ECS_COMPONENT_NOT_REGISTERED

#define ECS_COMPONENT_NOT_REGISTERED   (25)

Definition at line 536 of file log.h.

◆ ECS_CONSTRAINT_VIOLATED

#define ECS_CONSTRAINT_VIOLATED   (3)

Definition at line 517 of file log.h.

◆ ECS_CYAN

#define ECS_CYAN   "\033[0;36m"

Definition at line 564 of file log.h.

◆ ECS_CYCLE_DETECTED

#define ECS_CYCLE_DETECTED   (13)

Definition at line 527 of file log.h.

◆ ecs_dbg

#define ecs_dbg   ecs_dbg_1

Definition at line 335 of file log.h.

◆ ecs_dbg_1

#define ecs_dbg_1 ( ...)    ecs_log(1, __VA_ARGS__);

Definition at line 241 of file log.h.

◆ ecs_dbg_2

#define ecs_dbg_2 ( ...)    ecs_log(2, __VA_ARGS__);

Definition at line 242 of file log.h.

◆ ecs_dbg_3

#define ecs_dbg_3 ( ...)    ecs_log(3, __VA_ARGS__);

Definition at line 243 of file log.h.

◆ ecs_dbg_assert

#define ecs_dbg_assert ( condition,
error_code,
... )   ecs_assert(condition, error_code, __VA_ARGS__)

Debug assert.

Assert that is only valid in debug mode (ignores FLECS_KEEP_ASSERT)

Definition at line 367 of file log.h.

◆ ecs_deprecated

#define ecs_deprecated ( ...)     ecs_deprecated_(__FILE__, __LINE__, __VA_ARGS__)

Definition at line 221 of file log.h.

◆ ECS_DOUBLE_FREE

#define ECS_DOUBLE_FREE   (15)

Definition at line 529 of file log.h.

◆ ecs_dummy_check

#define ecs_dummy_check
Value:
if ((false)) {\
goto error;\
}

Definition at line 382 of file log.h.

◆ ecs_err

#define ecs_err ( ...)    ecs_err_(__FILE__, __LINE__, __VA_ARGS__)

Definition at line 213 of file log.h.

◆ ecs_err_

#define ecs_err_ ( file,
line,
... )   ecs_log_(-3, file, line, __VA_ARGS__)

Definition at line 212 of file log.h.

◆ ecs_fatal

#define ecs_fatal ( ...)    ecs_fatal_(__FILE__, __LINE__, __VA_ARGS__)

Definition at line 217 of file log.h.

◆ ecs_fatal_

#define ecs_fatal_ ( file,
line,
... )   ecs_log_(-4, file, line, __VA_ARGS__)

Definition at line 216 of file log.h.

◆ ECS_GREEN

#define ECS_GREEN   "\033[0;32m"

Definition at line 560 of file log.h.

◆ ECS_GREY

#define ECS_GREY   "\033[0;37m"

Definition at line 566 of file log.h.

◆ ECS_ID_IN_USE

#define ECS_ID_IN_USE   (12)

Definition at line 526 of file log.h.

◆ ECS_INCONSISTENT_COMPONENT_ACTION

#define ECS_INCONSISTENT_COMPONENT_ACTION   (27)

Definition at line 538 of file log.h.

◆ ECS_INCONSISTENT_COMPONENT_ID

#define ECS_INCONSISTENT_COMPONENT_ID   (26)

Definition at line 537 of file log.h.

◆ ECS_INCONSISTENT_NAME

#define ECS_INCONSISTENT_NAME   (20)

Definition at line 531 of file log.h.

◆ ECS_INTERNAL_ERROR

#define ECS_INTERNAL_ERROR   (7)

Definition at line 521 of file log.h.

◆ ECS_INVALID_COMPONENT_ALIGNMENT

#define ECS_INVALID_COMPONENT_ALIGNMENT   (24)

Definition at line 535 of file log.h.

◆ ECS_INVALID_COMPONENT_SIZE

#define ECS_INVALID_COMPONENT_SIZE   (23)

Definition at line 534 of file log.h.

◆ ECS_INVALID_CONVERSION

#define ECS_INVALID_CONVERSION   (11)

Definition at line 525 of file log.h.

◆ ECS_INVALID_FROM_WORKER

#define ECS_INVALID_FROM_WORKER   (72)

Definition at line 551 of file log.h.

◆ ECS_INVALID_OPERATION

#define ECS_INVALID_OPERATION   (1)

Definition at line 515 of file log.h.

◆ ECS_INVALID_PARAMETER

#define ECS_INVALID_PARAMETER   (2)

Definition at line 516 of file log.h.

◆ ECS_INVALID_WHILE_READONLY

#define ECS_INVALID_WHILE_READONLY   (70)

Definition at line 549 of file log.h.

◆ ECS_LEAK_DETECTED

#define ECS_LEAK_DETECTED   (14)

Definition at line 528 of file log.h.

◆ ECS_LOCKED_STORAGE

#define ECS_LOCKED_STORAGE   (71)

Definition at line 550 of file log.h.

◆ ecs_log

#define ecs_log ( level,
... )    ecs_log_(level, __FILE__, __LINE__, __VA_ARGS__)

Definition at line 197 of file log.h.

◆ ecs_log_pop

#define ecs_log_pop ( )    ecs_log_pop_(0)

Definition at line 339 of file log.h.

◆ ecs_log_pop_1

#define ecs_log_pop_1 ( )    ecs_log_pop_(1);

Definition at line 249 of file log.h.

◆ ecs_log_pop_2

#define ecs_log_pop_2 ( )    ecs_log_pop_(2);

Definition at line 250 of file log.h.

◆ ecs_log_pop_3

#define ecs_log_pop_3 ( )    ecs_log_pop_(3);

Definition at line 251 of file log.h.

◆ ecs_log_push

#define ecs_log_push ( )    ecs_log_push_(0)

Definition at line 338 of file log.h.

◆ ecs_log_push_1

#define ecs_log_push_1 ( )    ecs_log_push_(1);

Definition at line 245 of file log.h.

◆ ecs_log_push_2

#define ecs_log_push_2 ( )    ecs_log_push_(2);

Definition at line 246 of file log.h.

◆ ecs_log_push_3

#define ecs_log_push_3 ( )    ecs_log_push_(3);

Definition at line 247 of file log.h.

◆ ecs_logv

#define ecs_logv ( level,
fmt,
args )    ecs_logv_(level, __FILE__, __LINE__, fmt, args)

Definition at line 200 of file log.h.

◆ ECS_MAGENTA

#define ECS_MAGENTA   "\033[0;35m"

Definition at line 563 of file log.h.

◆ ECS_MISSING_OS_API

#define ECS_MISSING_OS_API   (9)

Definition at line 523 of file log.h.

◆ ECS_MISSING_SYMBOL

#define ECS_MISSING_SYMBOL   (29)

Definition at line 540 of file log.h.

◆ ECS_MODULE_UNDEFINED

#define ECS_MODULE_UNDEFINED   (28)

Definition at line 539 of file log.h.

◆ ECS_NAME_IN_USE

#define ECS_NAME_IN_USE   (21)

Definition at line 532 of file log.h.

◆ ECS_NORMAL

#define ECS_NORMAL   "\033[0;49m"

Definition at line 567 of file log.h.

◆ ECS_NOT_A_COMPONENT

#define ECS_NOT_A_COMPONENT   (22)

Definition at line 533 of file log.h.

◆ ECS_OPERATION_FAILED

#define ECS_OPERATION_FAILED   (10)

Definition at line 524 of file log.h.

◆ ECS_OUT_OF_MEMORY

#define ECS_OUT_OF_MEMORY   (4)

Definition at line 518 of file log.h.

◆ ECS_OUT_OF_RANGE

#define ECS_OUT_OF_RANGE   (5)

Definition at line 519 of file log.h.

◆ ecs_parser_error

#define ecs_parser_error ( name,
expr,
column,
... )    ecs_parser_error_(name, expr, column, __VA_ARGS__)

Parser error.

Definition at line 422 of file log.h.

◆ ecs_parser_errorv

#define ecs_parser_errorv ( name,
expr,
column,
fmt,
args )    ecs_parser_errorv_(name, expr, column, fmt, args)

Definition at line 425 of file log.h.

◆ ecs_print

#define ecs_print ( level,
... )    ecs_print_(level, __FILE__, __LINE__, __VA_ARGS__)

Definition at line 191 of file log.h.

◆ ecs_printv

#define ecs_printv ( level,
fmt,
args )    ecs_printv_(level, __FILE__, __LINE__, fmt, args)

Definition at line 194 of file log.h.

◆ ECS_RED

#define ECS_RED   "\033[0;31m"

Definition at line 559 of file log.h.

◆ ecs_san_assert

#define ecs_san_assert ( condition,
error_code,
... )

Sanitize assert.

Assert that is only valid in sanitized mode (ignores FLECS_KEEP_ASSERT)

Definition at line 377 of file log.h.

◆ ecs_should_log_1

#define ecs_should_log_1 ( )    ecs_should_log(1)

Definition at line 253 of file log.h.

◆ ecs_should_log_2

#define ecs_should_log_2 ( )    ecs_should_log(2)

Definition at line 254 of file log.h.

◆ ecs_should_log_3

#define ecs_should_log_3 ( )    ecs_should_log(3)

Definition at line 255 of file log.h.

◆ ecs_throw

#define ecs_throw ( error_code,
... )
Value:
ecs_abort(error_code, __VA_ARGS__);\
ecs_dummy_check
#define ecs_abort(error_code,...)
Abort.
Definition log.h:343

Panic.

goto error when FLECS_SOFT_ASSERT is defined, otherwise abort

Definition at line 415 of file log.h.

◆ ecs_trace

#define ecs_trace ( ...)    ecs_trace_(__FILE__, __LINE__, __VA_ARGS__)

Definition at line 205 of file log.h.

◆ ecs_trace_

#define ecs_trace_ ( file,
line,
... )   ecs_log_(0, file, line, __VA_ARGS__)

Definition at line 204 of file log.h.

◆ ECS_UNSUPPORTED

#define ECS_UNSUPPORTED   (6)

Definition at line 520 of file log.h.

◆ ecs_warn

#define ecs_warn ( ...)    ecs_warn_(__FILE__, __LINE__, __VA_ARGS__)

Definition at line 209 of file log.h.

◆ ecs_warn_

#define ecs_warn_ ( file,
line,
... )   ecs_log_(-2, file, line, __VA_ARGS__)

Definition at line 208 of file log.h.

◆ ECS_WHITE

#define ECS_WHITE   "\033[1;37m"

Definition at line 565 of file log.h.

◆ ECS_YELLOW

#define ECS_YELLOW   "\033[0;33m"

Definition at line 561 of file log.h.

◆ FLECS_LOG_0

#define FLECS_LOG_0

Definition at line 259 of file log.h.

◆ FLECS_LOG_1

#define FLECS_LOG_1

Definition at line 258 of file log.h.

◆ FLECS_LOG_2

#define FLECS_LOG_2

Definition at line 257 of file log.h.

◆ FLECS_LOG_3

#define FLECS_LOG_3   /* Enable all tracing in debug mode. May slow things down */

Definition at line 230 of file log.h.

Function Documentation

◆ ecs_log_enable_colors()

FLECS_API bool ecs_log_enable_colors ( bool enabled)

Enable/disable tracing with colors.

By default colors are enabled.

Parameters
enabledWhether to enable tracing with colors.
Returns
Previous color setting.

◆ ecs_log_enable_timedelta()

FLECS_API bool ecs_log_enable_timedelta ( bool enabled)

Enable/disable logging time since last log.

By default deltatime is disabled. Note that enabling timestamps introduces overhead as the logging code will need to obtain the current time.

When enabled, this logs the amount of time in seconds passed since the last log, when this amount is non-zero. The format is a '+' character followed by the number of seconds:

+1 trace: log message
Parameters
enabledWhether to enable tracing with timestamps.
Returns
Previous timestamp setting.

◆ ecs_log_enable_timestamp()

FLECS_API bool ecs_log_enable_timestamp ( bool enabled)

Enable/disable logging timestamp.

By default timestamps are disabled. Note that enabling timestamps introduces overhead as the logging code will need to obtain the current time.

Parameters
enabledWhether to enable tracing with timestamps.
Returns
Previous timestamp setting.

◆ ecs_log_get_level()

FLECS_API int ecs_log_get_level ( void )

Get current log level.

Returns
Previous log level.

◆ ecs_log_last_error()

FLECS_API int ecs_log_last_error ( void )

Get last logged error code.

Calling this operation resets the error code.

Returns
Last error, 0 if none was logged since last call to last_error.

◆ ecs_log_pop_()

FLECS_API void ecs_log_pop_ ( int32_t level)

Decrease log stack.

This operation decreases the indent_ value of the OS API and can be useful to make nested behavior more visible.

Parameters
levelThe log level.

◆ ecs_log_push_()

FLECS_API void ecs_log_push_ ( int32_t level)

Increase log stack.

This operation increases the indent_ value of the OS API and can be useful to make nested behavior more visible.

Parameters
levelThe log level.

◆ ecs_log_set_level()

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
levelDesired tracing level.
Returns
Previous log level.

◆ ecs_should_log()

FLECS_API bool ecs_should_log ( int32_t level)

Should current level be logged.

This operation returns true when the specified log level should be logged with the current log level.

Parameters
levelThe log level to check for.
Returns
Whether logging is enabled for the current level.