Blender
V3.3
|
Go to the source code of this file.
Classes | |
struct | CLG_LogType |
struct | CLG_LogRef |
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 | |||
) |
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_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__) |
typedef struct CLG_LogRef CLG_LogRef |
typedef struct CLG_LogType CLG_LogType |
enum CLG_LogFlag |
enum CLG_Severity |
Definition at line 733 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 787 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().
Definition at line 723 of file clog.c.
References CLT_ctx_error_fn_set(), CLogContext::error_fn, and g_ctx.
Referenced by arg_handle_debug_exit_on_error().
Definition at line 703 of file clog.c.
References CLG_ctx_free(), and g_ctx.
Referenced by blender::gpu::shader_builder::ShaderBuilder::exit(), main(), blender::bke::image::partial_update::ImagePartialUpdateTest::TearDown(), blender::gpu::GPUTest::TearDown(), BlendfileLoadingBaseTest::TearDownTestCase(), blender::bke::tests::AssetCatalogTest::TearDownTestSuite(), blender::bke::tests::AssetLibraryServiceTest::TearDownTestSuite(), blender::bke::tests::AssetLibraryTest::TearDownTestSuite(), blender::bke::tests::BPathTest::TearDownTestSuite(), blender::bke::tests::TEST(), WM_exit_ex(), and blender::bke::tests::Context< TestData >::~Context().
Definition at line 728 of file clog.c.
References CLG_ctx_fatal_fn_set(), CLogContext::fatal_fn, and g_ctx.
Referenced by main().
Definition at line 696 of file clog.c.
References clg_color_table_init(), CLG_ctx_init(), g_ctx, and CLogContext::use_color.
Referenced by blender::bke::tests::Context< TestData >::Context(), blender::gpu::shader_builder::ShaderBuilder::init(), main(), blender::bke::image::partial_update::ImagePartialUpdateTest::SetUp(), blender::gpu::GPUTest::SetUp(), BlendfileLoadingBaseTest::SetUpTestCase(), blender::bke::tests::AssetCatalogTest::SetUpTestSuite(), blender::bke::tests::AssetLibraryServiceTest::SetUpTestSuite(), blender::bke::tests::AssetLibraryTest::SetUpTestSuite(), blender::bke::tests::BPathTest::SetUpTestSuite(), and blender::bke::tests::TEST().
void CLG_level_set | ( | int | level | ) |
Definition at line 748 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 761 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().
Definition at line 708 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 713 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 718 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 738 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 743 of file clog.c.
References CLG_ctx_type_filter_include(), and g_ctx.
Referenced by arg_handle_debug_gpu_set(), and arg_handle_log_set().