|
Blender
V2.93
|
Go to the source code of this file.
Classes | |
| struct | CLG_LogType |
| struct | CLG_LogRef |
Macros | |
| #define | _CLOG_ATTR_NONNULL(...) |
| #define | _CLOG_ATTR_PRINTF_FORMAT(format_param, dots_param) |
| #define | STRINGIFY_ARG(x) "" #x |
| #define | STRINGIFY_APPEND(a, b) "" a #b |
| #define | STRINGIFY(x) STRINGIFY_APPEND("", x) |
| #define | CLG_SEVERITY_LEN (CLG_SEVERITY_FATAL + 1) |
| #define | CLG_LOGREF_DECLARE_GLOBAL(var, id) |
| #define | CLOG_ENSURE(clg_ref) ((clg_ref)->type ? (clg_ref)->type : (CLG_logref_init(clg_ref), (clg_ref)->type)) |
| #define | CLOG_CHECK(clg_ref, verbose_level, ...) |
| #define | CLOG_AT_SEVERITY(clg_ref, severity, verbose_level, ...) |
| #define | CLOG_STR_AT_SEVERITY(clg_ref, severity, verbose_level, str) |
| #define | CLOG_STR_AT_SEVERITY_N(clg_ref, severity, verbose_level, str) |
| #define | CLOG_INFO(clg_ref, level, ...) CLOG_AT_SEVERITY(clg_ref, CLG_SEVERITY_INFO, level, __VA_ARGS__) |
| #define | CLOG_WARN(clg_ref, ...) CLOG_AT_SEVERITY(clg_ref, CLG_SEVERITY_WARN, 0, __VA_ARGS__) |
| #define | CLOG_ERROR(clg_ref, ...) CLOG_AT_SEVERITY(clg_ref, CLG_SEVERITY_ERROR, 0, __VA_ARGS__) |
| #define | CLOG_FATAL(clg_ref, ...) CLOG_AT_SEVERITY(clg_ref, CLG_SEVERITY_FATAL, 0, __VA_ARGS__) |
| #define | CLOG_STR_INFO(clg_ref, level, str) CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_INFO, level, str) |
| #define | CLOG_STR_WARN(clg_ref, str) CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_WARN, 0, str) |
| #define | CLOG_STR_ERROR(clg_ref, str) CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_ERROR, 0, str) |
| #define | CLOG_STR_FATAL(clg_ref, str) CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_FATAL, 0, str) |
| #define | CLOG_STR_INFO_N(clg_ref, level, str) CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_INFO, level, str) |
| #define | CLOG_STR_WARN_N(clg_ref, str) CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_WARN, 0, str) |
| #define | CLOG_STR_ERROR_N(clg_ref, str) CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_ERROR, 0, str) |
| #define | CLOG_STR_FATAL_N(clg_ref, str) CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_FATAL, 0, str) |
Typedefs | |
| typedef struct CLG_LogType | CLG_LogType |
| typedef struct CLG_LogRef | CLG_LogRef |
Enumerations | |
| enum | CLG_LogFlag { CLG_FLAG_USE = (1 << 0) } |
| enum | CLG_Severity { CLG_SEVERITY_INFO = 0 , CLG_SEVERITY_WARN , CLG_SEVERITY_ERROR , CLG_SEVERITY_FATAL } |
Functions | |
| void | CLG_log_str (CLG_LogType *lg, enum CLG_Severity severity, const char *file_line, const char *fn, const char *message) _CLOG_ATTR_NONNULL(1 |
| void void | CLG_logf (CLG_LogType *lg, enum CLG_Severity severity, const char *file_line, const char *fn, const char *format,...) _CLOG_ATTR_NONNULL(1 |
| void void | _CLOG_ATTR_PRINTF_FORMAT (5, 6) |
| void | CLG_init (void) |
| void | CLG_exit (void) |
| void | CLG_output_set (void *file_handle) |
| void | CLG_output_use_basename_set (int value) |
| void | CLG_output_use_timestamp_set (int value) |
| void | CLG_error_fn_set (void(*error_fn)(void *file_handle)) |
| void | CLG_fatal_fn_set (void(*fatal_fn)(void *file_handle)) |
| void | CLG_backtrace_fn_set (void(*fatal_fn)(void *file_handle)) |
| void | CLG_type_filter_include (const char *type_filter, int type_filter_len) |
| void | CLG_type_filter_exclude (const char *type_filter, int type_filter_len) |
| void | CLG_level_set (int level) |
| void | CLG_logref_init (CLG_LogRef *clg_ref) |
| int | CLG_color_support_get (CLG_LogRef *clg_ref) |
CLG_LOGREF_DECLARE_GLOBAL macro to declare CLG_LogRef pointers.CLOG_ prefixed macros for logging.CLG_LogRef holds an identifier which defines the category of the logger.
You can define and use identifiers as needed, logging will lazily initialize them.
By convention lower case dot separated identifiers are used, eg: module.sub_module, this allows filtering by module.*, see CLG_type_filter_include, CLG_type_filter_exclude
There is currently no functionality to remove a category once it's created.
INFO: Simply log events, uses verbosity levels to control how much information to show.WARN: General warnings (which aren't necessary to show to users).ERROR: An error we can recover from, should not happen.FATAL: Similar to assert. This logs the message, then a stack trace and abort. Usage:
Definition in file CLG_log.h.
| #define _CLOG_ATTR_PRINTF_FORMAT | ( | format_param, | |
| dots_param | |||
| ) |
| #define CLG_LOGREF_DECLARE_GLOBAL | ( | var, | |
| id | |||
| ) |
Declare outside function, declare as extern in header.
| #define CLG_SEVERITY_LEN (CLG_SEVERITY_FATAL + 1) |
| #define CLOG_AT_SEVERITY | ( | clg_ref, | |
| severity, | |||
| verbose_level, | |||
| ... | |||
| ) |
| #define CLOG_CHECK | ( | clg_ref, | |
| verbose_level, | |||
| ... | |||
| ) |
| #define CLOG_ENSURE | ( | clg_ref | ) | ((clg_ref)->type ? (clg_ref)->type : (CLG_logref_init(clg_ref), (clg_ref)->type)) |
| #define CLOG_ERROR | ( | clg_ref, | |
| ... | |||
| ) | CLOG_AT_SEVERITY(clg_ref, CLG_SEVERITY_ERROR, 0, __VA_ARGS__) |
| #define CLOG_FATAL | ( | clg_ref, | |
| ... | |||
| ) | CLOG_AT_SEVERITY(clg_ref, CLG_SEVERITY_FATAL, 0, __VA_ARGS__) |
| #define CLOG_INFO | ( | clg_ref, | |
| level, | |||
| ... | |||
| ) | CLOG_AT_SEVERITY(clg_ref, CLG_SEVERITY_INFO, level, __VA_ARGS__) |
| #define CLOG_STR_AT_SEVERITY | ( | clg_ref, | |
| severity, | |||
| verbose_level, | |||
| str | |||
| ) |
| #define CLOG_STR_AT_SEVERITY_N | ( | clg_ref, | |
| severity, | |||
| verbose_level, | |||
| str | |||
| ) |
| #define CLOG_STR_ERROR | ( | clg_ref, | |
| str | |||
| ) | CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_ERROR, 0, str) |
| #define CLOG_STR_ERROR_N | ( | clg_ref, | |
| str | |||
| ) | CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_ERROR, 0, str) |
| #define CLOG_STR_FATAL | ( | clg_ref, | |
| str | |||
| ) | CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_FATAL, 0, str) |
| #define CLOG_STR_FATAL_N | ( | clg_ref, | |
| str | |||
| ) | CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_FATAL, 0, str) |
| #define CLOG_STR_INFO | ( | clg_ref, | |
| level, | |||
| str | |||
| ) | CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_INFO, level, str) |
| #define CLOG_STR_INFO_N | ( | clg_ref, | |
| level, | |||
| str | |||
| ) | CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_INFO, level, str) |
| #define CLOG_STR_WARN | ( | clg_ref, | |
| str | |||
| ) | CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_WARN, 0, str) |
| #define CLOG_STR_WARN_N | ( | clg_ref, | |
| str | |||
| ) | CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_WARN, 0, str) |
| #define CLOG_WARN | ( | clg_ref, | |
| ... | |||
| ) | CLOG_AT_SEVERITY(clg_ref, CLG_SEVERITY_WARN, 0, __VA_ARGS__) |
| #define STRINGIFY | ( | x | ) | STRINGIFY_APPEND("", x) |
| typedef struct CLG_LogRef CLG_LogRef |
| typedef struct CLG_LogType CLG_LogType |
| enum CLG_LogFlag |
| enum CLG_Severity |
| void void _CLOG_ATTR_PRINTF_FORMAT | ( | 5 | , |
| 6 | |||
| ) |
| void CLG_backtrace_fn_set | ( | void(*)(void *file_handle) | fatal_fn | ) |
Definition at line 745 of file clog.c.
References CLG_ctx_backtrace_fn_set(), CLogContext::fatal_fn, and g_ctx.
Referenced by arg_handle_log_show_backtrace_set().
| int CLG_color_support_get | ( | CLG_LogRef * | clg_ref | ) |
Definition at line 799 of file clog.c.
References CLG_logref_init(), CLG_LogType::ctx, NULL, CLG_LogRef::type, and CLogContext::use_color.
Referenced by blender::gpu::debug::debug_callback(), and blender::gpu::Shader::print_log().
| void CLG_error_fn_set | ( | void(*)(void *file_handle) | error_fn | ) |
Definition at line 735 of file clog.c.
References CLT_ctx_error_fn_set(), CLogContext::error_fn, and g_ctx.
Referenced by arg_handle_debug_exit_on_error().
| void CLG_exit | ( | void | ) |
Definition at line 715 of file clog.c.
References CLG_ctx_free(), and g_ctx.
Referenced by main(), BlendfileLoadingBaseTest::TearDownTestCase(), blender::bke::tests::TEST(), and WM_exit_ex().
| void CLG_fatal_fn_set | ( | void(*)(void *file_handle) | fatal_fn | ) |
Definition at line 740 of file clog.c.
References CLG_ctx_fatal_fn_set(), CLogContext::fatal_fn, and g_ctx.
Referenced by main().
| void CLG_init | ( | void | ) |
Definition at line 708 of file clog.c.
References clg_color_table_init(), CLG_ctx_init(), g_ctx, and CLogContext::use_color.
Referenced by main(), BlendfileLoadingBaseTest::SetUpTestCase(), and blender::bke::tests::TEST().
| void CLG_level_set | ( | int | level | ) |
Definition at line 760 of file clog.c.
References CLG_ctx_level_set(), g_ctx, and CLogContext::level.
Referenced by arg_handle_log_level_set(), and main().
| void CLG_log_str | ( | CLG_LogType * | lg, |
| enum CLG_Severity | severity, | ||
| const char * | file_line, | ||
| const char * | fn, | ||
| const char * | message | ||
| ) |
Referenced by blender::gpu::Shader::print_log().
| void void CLG_logf | ( | CLG_LogType * | lg, |
| enum CLG_Severity | severity, | ||
| const char * | file_line, | ||
| const char * | fn, | ||
| const char * | format, | ||
| ... | |||
| ) |
Referenced by blender::gpu::debug::debug_callback().
| void CLG_logref_init | ( | CLG_LogRef * | clg_ref | ) |
Definition at line 773 of file clog.c.
References atomic_cas_ptr(), clg_ctx_type_find_by_name(), clg_ctx_type_register(), g_ctx, CLG_LogRef::identifier, CLG_LogRef::next, NULL, CLogContext::refs, and CLG_LogRef::type.
Referenced by CLG_color_support_get().
| void CLG_output_set | ( | void * | file_handle | ) |
Definition at line 720 of file clog.c.
References CLG_ctx_output_set(), and g_ctx.
Referenced by arg_handle_log_file_set().
| void CLG_output_use_basename_set | ( | int | value | ) |
Definition at line 725 of file clog.c.
References CLG_ctx_output_use_basename_set(), and g_ctx.
Referenced by arg_handle_log_show_basename_set(), and main().
| void CLG_output_use_timestamp_set | ( | int | value | ) |
Definition at line 730 of file clog.c.
References CLG_ctx_output_use_timestamp_set(), and g_ctx.
Referenced by arg_handle_log_show_timestamp_set().
| void CLG_type_filter_exclude | ( | const char * | type_filter, |
| int | type_filter_len | ||
| ) |
Definition at line 750 of file clog.c.
References CLG_ctx_type_filter_exclude(), and g_ctx.
Referenced by arg_handle_log_set().
| void CLG_type_filter_include | ( | const char * | type_filter, |
| int | type_filter_len | ||
| ) |
Definition at line 755 of file clog.c.
References CLG_ctx_type_filter_include(), and g_ctx.
Referenced by arg_handle_log_set().