diff --git a/intern/clog/CLG_log.h b/intern/clog/CLG_log.h index beff43984cf..fadc2f05f1d 100644 --- a/intern/clog/CLG_log.h +++ b/intern/clog/CLG_log.h @@ -74,18 +74,15 @@ struct CLogContext; -/* Don't typedef enums. */ -enum CLG_LogFlag { - CLG_FLAG_USE = (1 << 0), +enum CLG_Level { + CLG_LEVEL_FATAL = 0, /* Fatal errors */ + CLG_LEVEL_ERROR = 1, /* Errors */ + CLG_LEVEL_WARN = 2, /* Warnings */ + CLG_LEVEL_INFO = 3, /* Information about devices, files, configuration, user operations */ + CLG_LEVEL_DEBUG = 4, /* Debugging information for developers */ + CLG_LEVEL_TRACE = 5, /* Very verbose code execution tracing */ }; - -enum CLG_Severity { - CLG_SEVERITY_INFO = 0, - CLG_SEVERITY_WARN, - CLG_SEVERITY_ERROR, - CLG_SEVERITY_FATAL, -}; -#define CLG_SEVERITY_LEN (CLG_SEVERITY_FATAL + 1) +#define CLG_LEVEL_LEN (CLG_LEVEL_TRACE + 1) /* Each logger ID has one of these. */ struct CLG_LogType { @@ -94,8 +91,7 @@ struct CLG_LogType { /** FILE output. */ struct CLogContext *ctx; /** Control behavior. */ - int level; - int flag; + CLG_Level level; }; struct CLG_LogRef { @@ -105,12 +101,12 @@ struct CLG_LogRef { }; void CLG_log_str(const CLG_LogType *lg, - enum CLG_Severity severity, + enum CLG_Level level, const char *file_line, const char *fn, const char *message) _CLOG_ATTR_NONNULL(1, 3, 4, 5); void CLG_logf(const CLG_LogType *lg, - enum CLG_Severity severity, + enum CLG_Level level, const char *file_line, const char *fn, const char *format, @@ -132,7 +128,7 @@ void CLG_backtrace_fn_set(void (*fatal_fn)(void *file_handle)); void CLG_type_filter_include(const char *type_match, int type_match_len); void CLG_type_filter_exclude(const char *type_match, int type_match_len); -void CLG_level_set(int level); +void CLG_level_set(CLG_Level level); void CLG_logref_init(CLG_LogRef *clg_ref); @@ -148,49 +144,54 @@ int CLG_color_support_get(CLG_LogRef *clg_ref); ((clg_ref)->type ? (clg_ref)->type : (CLG_logref_init(clg_ref), (clg_ref)->type)) #define CLOG_CHECK(clg_ref, verbose_level, ...) \ - ((void)CLOG_ENSURE(clg_ref), \ - ((clg_ref)->type->flag & CLG_FLAG_USE) && ((clg_ref)->type->level >= verbose_level)) + ((void)CLOG_ENSURE(clg_ref), ((clg_ref)->type->level >= verbose_level)) -#define CLOG_AT_SEVERITY(clg_ref, severity, verbose_level, ...) \ +#define CLOG_AT_LEVEL(clg_ref, verbose_level, ...) \ { \ const CLG_LogType *_lg_ty = CLOG_ENSURE(clg_ref); \ - if (((_lg_ty->flag & CLG_FLAG_USE) && (_lg_ty->level >= verbose_level)) || \ - (severity >= CLG_SEVERITY_WARN)) \ - { \ - CLG_logf(_lg_ty, severity, __FILE__ ":" STRINGIFY(__LINE__), __func__, __VA_ARGS__); \ + if (_lg_ty->level >= verbose_level) { \ + CLG_logf(_lg_ty, verbose_level, __FILE__ ":" STRINGIFY(__LINE__), __func__, __VA_ARGS__); \ } \ } \ ((void)0) -#define CLOG_AT_SEVERITY_NOCHECK(clg_ref, severity, ...) \ +#define CLOG_AT_LEVEL_NOCHECK(clg_ref, verbose_level, ...) \ { \ const CLG_LogType *_lg_ty = CLOG_ENSURE(clg_ref); \ - CLG_logf(_lg_ty, severity, __FILE__ ":" STRINGIFY(__LINE__), __func__, __VA_ARGS__); \ + CLG_logf(_lg_ty, verbose_level, __FILE__ ":" STRINGIFY(__LINE__), __func__, __VA_ARGS__); \ } \ ((void)0) -#define CLOG_STR_AT_SEVERITY(clg_ref, severity, verbose_level, str) \ +#define CLOG_STR_AT_LEVEL(clg_ref, verbose_level, str) \ { \ const CLG_LogType *_lg_ty = CLOG_ENSURE(clg_ref); \ - if (((_lg_ty->flag & CLG_FLAG_USE) && (_lg_ty->level >= verbose_level)) || \ - (severity >= CLG_SEVERITY_WARN)) \ - { \ - CLG_log_str(_lg_ty, severity, __FILE__ ":" STRINGIFY(__LINE__), __func__, str); \ + if (_lg_ty->level >= verbose_level) { \ + CLG_log_str(_lg_ty, verbose_level, __FILE__ ":" STRINGIFY(__LINE__), __func__, str); \ } \ } \ ((void)0) -#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_AT_LEVEL_NOCHECK(clg_ref, verbose_level, str) \ + { \ + const CLG_LogType *_lg_ty = CLOG_ENSURE(clg_ref); \ + CLG_log_str(_lg_ty, verbose_level, __FILE__ ":" STRINGIFY(__LINE__), __func__, str); \ + } \ + ((void)0) -#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_FATAL(clg_ref, ...) CLOG_AT_LEVEL(clg_ref, CLG_LEVEL_FATAL, __VA_ARGS__) +#define CLOG_ERROR(clg_ref, ...) CLOG_AT_LEVEL(clg_ref, CLG_LEVEL_ERROR, __VA_ARGS__) +#define CLOG_WARN(clg_ref, ...) CLOG_AT_LEVEL(clg_ref, CLG_LEVEL_WARN, __VA_ARGS__) +#define CLOG_INFO(clg_ref, ...) CLOG_AT_LEVEL(clg_ref, CLG_LEVEL_INFO, __VA_ARGS__) +#define CLOG_DEBUG(clg_ref, ...) CLOG_AT_LEVEL(clg_ref, CLG_LEVEL_DEBUG, __VA_ARGS__) +#define CLOG_TRACE(clg_ref, ...) CLOG_AT_LEVEL(clg_ref, CLG_LEVEL_TRACE, __VA_ARGS__) + +#define CLOG_STR_FATAL(clg_ref, str) CLOG_STR_AT_LEVEL(clg_ref, CLG_LEVEL_FATAL, str) +#define CLOG_STR_ERROR(clg_ref, str) CLOG_STR_AT_LEVEL(clg_ref, CLG_LEVEL_ERROR, str) +#define CLOG_STR_WARN(clg_ref, str) CLOG_STR_AT_LEVEL(clg_ref, CLG_LEVEL_WARN, str) +#define CLOG_STR_INFO(clg_ref, str) CLOG_STR_AT_LEVEL(clg_ref, CLG_LEVEL_INFO, str) +#define CLOG_STR_DEBUG(clg_ref, str) CLOG_STR_AT_LEVEL(clg_ref, CLG_LEVEL_DEBUG, str) +#define CLOG_STR_TRACE(clg_ref, str) CLOG_STR_AT_LEVEL(clg_ref, CLG_LEVEL_TRACE, str) #define CLOG_INFO_NOCHECK(clg_ref, format, ...) \ - CLOG_AT_SEVERITY_NOCHECK(clg_ref, CLG_SEVERITY_INFO, format, __VA_ARGS__) + CLOG_AT_LEVEL_NOCHECK(clg_ref, CLG_LEVEL_INFO, format, __VA_ARGS__) +#define CLOG_STR_INFO_NOCHECK(clg_ref, str) CLOG_STR_AT_LEVEL_NOCHECK(clg_ref, CLG_LEVEL_INFO, str) diff --git a/intern/clog/clog.cc b/intern/clog/clog.cc index 2fca9bc6b52..d62f0d3c6b7 100644 --- a/intern/clog/clog.cc +++ b/intern/clog/clog.cc @@ -98,7 +98,7 @@ struct CLogContext { /** For new types. */ struct { - int level; + CLG_Level level; } default_type; struct { @@ -302,42 +302,42 @@ static void clg_color_table_init(bool use_color) } } -static const char *clg_severity_as_text(enum CLG_Severity severity) +static const char *clg_level_as_text(enum CLG_Level level) { - switch (severity) { - case CLG_SEVERITY_INFO: - return "INFO"; - case CLG_SEVERITY_WARN: - return "WARNING"; - case CLG_SEVERITY_ERROR: - return "ERROR"; - case CLG_SEVERITY_FATAL: + switch (level) { + case CLG_LEVEL_FATAL: return "FATAL"; + case CLG_LEVEL_ERROR: + return "ERROR"; + case CLG_LEVEL_WARN: + return "WARNING"; + case CLG_LEVEL_INFO: + return "INFO"; + case CLG_LEVEL_DEBUG: + return "DEBUG"; + case CLG_LEVEL_TRACE: + return "TRACE"; } - return "INVALID_SEVERITY"; + return "INVALID_LEVEL"; } -static enum eCLogColor clg_severity_to_color(enum CLG_Severity severity) +static enum eCLogColor clg_level_to_color(enum CLG_Level level) { - assert((unsigned int)severity < CLG_SEVERITY_LEN); - enum eCLogColor color = COLOR_DEFAULT; - switch (severity) { - case CLG_SEVERITY_INFO: - color = COLOR_DEFAULT; - break; - case CLG_SEVERITY_WARN: - color = COLOR_YELLOW; - break; - case CLG_SEVERITY_ERROR: - case CLG_SEVERITY_FATAL: - color = COLOR_RED; - break; - default: - /* should never get here. */ - assert(false); + switch (level) { + case CLG_LEVEL_FATAL: + case CLG_LEVEL_ERROR: + return COLOR_RED; + case CLG_LEVEL_WARN: + return COLOR_YELLOW; + case CLG_LEVEL_INFO: + case CLG_LEVEL_DEBUG: + case CLG_LEVEL_TRACE: + return COLOR_DEFAULT; } - return color; + /* should never get here. */ + assert(false); + return COLOR_DEFAULT; } /** \} */ @@ -354,7 +354,9 @@ static enum eCLogColor clg_severity_to_color(enum CLG_Severity severity) */ static bool clg_ctx_filter_check(CLogContext *ctx, const char *identifier) { - if (ctx->filters[0] == nullptr && ctx->filters[1] == nullptr && ctx->default_type.level >= 0) { + if (ctx->filters[0] == nullptr && ctx->filters[1] == nullptr && + ctx->default_type.level >= CLG_LEVEL_INFO) + { /* No filters but level specified? Match everything. */ return true; } @@ -415,11 +417,14 @@ static CLG_LogType *clg_ctx_type_register(CLogContext *ctx, const char *identifi ctx->types = ty; strncpy(ty->identifier, identifier, sizeof(ty->identifier) - 1); ty->ctx = ctx; - ty->level = ctx->default_type.level; if (clg_ctx_filter_check(ctx, ty->identifier)) { - ty->flag |= CLG_FLAG_USE; + ty->level = ctx->default_type.level; } + else { + ty->level = std::min(ctx->default_type.level, CLG_LEVEL_WARN); + } + return ty; } @@ -497,22 +502,20 @@ static void write_memory(CLogStringBuf *cstr) clg_str_append_char(cstr, ' ', num_spaces + 2); } -static void write_severity(CLogStringBuf *cstr, enum CLG_Severity severity, bool use_color) +static void write_level(CLogStringBuf *cstr, enum CLG_Level level, bool use_color) { - assert((unsigned int)severity < CLG_SEVERITY_LEN); - - if (severity == CLG_SEVERITY_INFO) { + if (level >= CLG_LEVEL_INFO) { return; } if (use_color) { - enum eCLogColor color = clg_severity_to_color(severity); + enum eCLogColor color = clg_level_to_color(level); clg_str_append(cstr, clg_color_table[color]); - clg_str_append(cstr, clg_severity_as_text(severity)); + clg_str_append(cstr, clg_level_as_text(level)); clg_str_append(cstr, clg_color_table[COLOR_RESET]); } else { - clg_str_append(cstr, clg_severity_as_text(severity)); + clg_str_append(cstr, clg_level_as_text(level)); } clg_str_append(cstr, " "); @@ -561,7 +564,7 @@ static void write_file_line_fn(CLogStringBuf *cstr, } void CLG_log_str(const CLG_LogType *lg, - enum CLG_Severity severity, + enum CLG_Level level, const char *file_line, const char *fn, const char *message) @@ -582,7 +585,7 @@ void CLG_log_str(const CLG_LogType *lg, const uint64_t multiline_indent_len = cstr.len; - write_severity(&cstr, severity, lg->ctx->use_color); + write_level(&cstr, level, lg->ctx->use_color); clg_str_append(&cstr, message); @@ -609,13 +612,13 @@ void CLG_log_str(const CLG_LogType *lg, clg_ctx_backtrace(lg->ctx); } - if (severity == CLG_SEVERITY_FATAL) { + if (level == CLG_LEVEL_FATAL) { clg_ctx_fatal_action(lg->ctx); } } void CLG_logf(const CLG_LogType *lg, - enum CLG_Severity severity, + enum CLG_Level level, const char *file_line, const char *fn, const char *format, @@ -637,7 +640,7 @@ void CLG_logf(const CLG_LogType *lg, const uint64_t multiline_indent_len = cstr.len; - write_severity(&cstr, severity, lg->ctx->use_color); + write_level(&cstr, level, lg->ctx->use_color); { va_list ap; @@ -669,11 +672,11 @@ void CLG_logf(const CLG_LogType *lg, clg_ctx_backtrace(lg->ctx); } - if (severity == CLG_SEVERITY_ERROR) { + if (level == CLG_LEVEL_ERROR) { clg_ctx_error_action(lg->ctx); } - if (severity == CLG_SEVERITY_FATAL) { + if (level == CLG_LEVEL_FATAL) { clg_ctx_fatal_action(lg->ctx); } } @@ -733,13 +736,13 @@ static void CLG_ctx_output_use_memory_set(CLogContext *ctx, int value) ctx->use_memory = (bool)value; } -/** Action on error severity. */ +/** Action on error level. */ static void CLT_ctx_error_fn_set(CLogContext *ctx, void (*error_fn)(void *file_handle)) { ctx->callbacks.error_fn = error_fn; } -/** Action on fatal severity. */ +/** Action on fatal level. */ static void CLG_ctx_fatal_fn_set(CLogContext *ctx, void (*fatal_fn)(void *file_handle)) { ctx->callbacks.fatal_fn = fatal_fn; @@ -777,12 +780,12 @@ static void CLG_ctx_type_filter_include(CLogContext *ctx, int type_match_len) { clg_ctx_type_filter_append(&ctx->filters[1], type_match, type_match_len); - if (ctx->default_type.level == -1) { - ctx->default_type.level = 1; + if (ctx->default_type.level <= CLG_LEVEL_WARN) { + ctx->default_type.level = CLG_LEVEL_INFO; } } -static void CLG_ctx_level_set(CLogContext *ctx, int level) +static void CLG_ctx_level_set(CLogContext *ctx, CLG_Level level) { ctx->default_type.level = level; for (CLG_LogType *ty = ctx->types; ty; ty = ty->next) { @@ -796,7 +799,7 @@ static CLogContext *CLG_ctx_init() #ifdef WITH_CLOG_PTHREADS pthread_mutex_init(&ctx->types_lock, nullptr); #endif - ctx->default_type.level = -1; + ctx->default_type.level = CLG_LEVEL_WARN; ctx->use_source = true; CLG_ctx_output_set(ctx, stdout); @@ -906,7 +909,7 @@ void CLG_type_filter_include(const char *type_match, int type_match_len) CLG_ctx_type_filter_include(g_ctx, type_match, type_match_len); } -void CLG_level_set(int level) +void CLG_level_set(CLG_Level level) { CLG_ctx_level_set(g_ctx, level); } diff --git a/intern/cycles/blender/logging.cpp b/intern/cycles/blender/logging.cpp index 5aa7ea47e4e..16d465396d5 100644 --- a/intern/cycles/blender/logging.cpp +++ b/intern/cycles/blender/logging.cpp @@ -18,15 +18,15 @@ void CCL_log_init() switch (level) { case ccl::FATAL: case ccl::DFATAL: - CLG_log_str(log_type, CLG_SEVERITY_FATAL, file_line, func, msg); + CLG_log_str(log_type, CLG_LEVEL_FATAL, file_line, func, msg); return; case ccl::ERROR: case ccl::DERROR: - CLG_log_str(log_type, CLG_SEVERITY_ERROR, file_line, func, msg); + CLG_log_str(log_type, CLG_LEVEL_ERROR, file_line, func, msg); return; case ccl::WARNING: case ccl::DWARNING: - CLG_log_str(log_type, CLG_SEVERITY_WARN, file_line, func, msg); + CLG_log_str(log_type, CLG_LEVEL_WARN, file_line, func, msg); return; case ccl::INFO: case ccl::INFO_IMPORTANT: @@ -34,31 +34,31 @@ void CCL_log_init() case ccl::STATS: case ccl::DEBUG: case ccl::UNKNOWN: - CLG_log_str(log_type, CLG_SEVERITY_INFO, file_line, func, msg); + CLG_log_str(log_type, CLG_LEVEL_INFO, file_line, func, msg); return; } }); /* Map log level from CLOG. */ const CLG_LogType *log_type = CLOG_ENSURE(&LOG); - if (log_type->flag & CLG_FLAG_USE) { - switch (log_type->level) { - case 0: - case 1: - ccl::log_level_set(ccl::INFO); - break; - case 2: - ccl::log_level_set(ccl::WORK); - break; - case 3: - ccl::log_level_set(ccl::STATS); - break; - default: - ccl::log_level_set(ccl::DEBUG); - break; - } - } - else { - ccl::log_level_set(ccl::ERROR); + switch (log_type->level) { + case CLG_LEVEL_FATAL: + ccl::log_level_set(ccl::FATAL); + break; + case CLG_LEVEL_ERROR: + ccl::log_level_set(ccl::ERROR); + break; + case CLG_LEVEL_WARN: + ccl::log_level_set(ccl::WARNING); + break; + case CLG_LEVEL_INFO: + ccl::log_level_set(ccl::INFO); + break; + case CLG_LEVEL_DEBUG: + ccl::log_level_set(ccl::WORK); + break; + case CLG_LEVEL_TRACE: + ccl::log_level_set(ccl::DEBUG); + break; } } diff --git a/intern/ghost/intern/GHOST_ContextVK.cc b/intern/ghost/intern/GHOST_ContextVK.cc index 4411f7c4ffc..b653986a23e 100644 --- a/intern/ghost/intern/GHOST_ContextVK.cc +++ b/intern/ghost/intern/GHOST_ContextVK.cc @@ -250,11 +250,11 @@ class GHOST_DeviceVK { for (const char *optional_extension : optional_extensions) { const bool extension_found = has_extensions({optional_extension}); if (extension_found) { - CLOG_INFO(&LOG, 2, "enable optional extension: `%s`", optional_extension); + CLOG_DEBUG(&LOG, "enable optional extension: `%s`", optional_extension); device_extensions.push_back(optional_extension); } else { - CLOG_INFO(&LOG, 2, "optional extension not found: `%s`", optional_extension); + CLOG_DEBUG(&LOG, "optional extension not found: `%s`", optional_extension); } } @@ -668,7 +668,7 @@ GHOST_TSuccess GHOST_ContextVK::swapBuffers() recreateSwapchain(use_hdr_swapchain); } } - CLOG_INFO(&LOG, 3, "render_frame=%lu, image_index=%u", m_render_frame, image_index); + CLOG_DEBUG(&LOG, "render_frame=%lu, image_index=%u", m_render_frame, image_index); GHOST_SwapchainImage &swapchain_image = m_swapchain_images[image_index]; GHOST_VulkanSwapChainData swap_chain_data; @@ -1089,20 +1089,19 @@ GHOST_TSuccess GHOST_ContextVK::recreateSwapchain(bool use_hdr_swapchain) for (int index = 0; index < actual_image_count; index++) { m_swapchain_images[index].vk_image = swapchain_images[index]; } - CLOG_INFO(&LOG, - 2, - "recreating swapchain: width=%u, height=%u, format=%d, colorSpace=%d, " - "present_mode=%d, image_count_requested=%u, image_count_acquired=%u, swapchain=%lx, " - "old_swapchain=%lx", - m_render_extent.width, - m_render_extent.height, - m_surface_format.format, - m_surface_format.colorSpace, - present_mode, - image_count_requested, - actual_image_count, - uint64_t(m_swapchain), - uint64_t(old_swapchain)); + CLOG_DEBUG(&LOG, + "recreating swapchain: width=%u, height=%u, format=%d, colorSpace=%d, " + "present_mode=%d, image_count_requested=%u, image_count_acquired=%u, swapchain=%lx, " + "old_swapchain=%lx", + m_render_extent.width, + m_render_extent.height, + m_surface_format.format, + m_surface_format.colorSpace, + present_mode, + image_count_requested, + actual_image_count, + uint64_t(m_swapchain), + uint64_t(old_swapchain)); /* Construct new semaphores. It can be that image_count is larger than previously. We only need * to fill in where the handle is `VK_NULL_HANDLE`. */ /* Previous handles from the frame data cannot be used and should be discarded. */ diff --git a/intern/ghost/intern/GHOST_NDOFManager.cc b/intern/ghost/intern/GHOST_NDOFManager.cc index 2097498958e..73ed1326f9b 100644 --- a/intern/ghost/intern/GHOST_NDOFManager.cc +++ b/intern/ghost/intern/GHOST_NDOFManager.cc @@ -307,7 +307,7 @@ bool GHOST_NDOFManager::setDevice(ushort vendor_id, ushort product_id) break; } default: { - CLOG_INFO(LOG, 2, "unknown Logitech product %04hx", product_id); + CLOG_DEBUG(LOG, "unknown Logitech product %04hx", product_id); } } break; @@ -349,23 +349,23 @@ bool GHOST_NDOFManager::setDevice(ushort vendor_id, ushort product_id) break; } default: { - CLOG_INFO(LOG, 2, "unknown 3Dconnexion product %04hx", product_id); + CLOG_DEBUG(LOG, "unknown 3Dconnexion product %04hx", product_id); } } break; default: - CLOG_INFO(LOG, 2, "unknown device %04hx:%04hx", vendor_id, product_id); + CLOG_DEBUG(LOG, "unknown device %04hx:%04hx", vendor_id, product_id); } if (device_type_ != NDOF_UnknownDevice) { - CLOG_INFO(LOG, 2, "using %s", ndof_device_names[device_type_]); + CLOG_DEBUG(LOG, "using %s", ndof_device_names[device_type_]); } if (hid_map_button_mask_ == 0) { hid_map_button_mask_ = int(~(UINT_MAX << hid_map_button_num_)); } - CLOG_INFO(LOG, 2, "%d buttons -> hex:%X", hid_map_button_num_, uint(hid_map_button_mask_)); + CLOG_DEBUG(LOG, "%d buttons -> hex:%X", hid_map_button_num_, uint(hid_map_button_mask_)); return device_type_ != NDOF_UnknownDevice; } @@ -509,12 +509,12 @@ void GHOST_NDOFManager::sendKeyEvent(GHOST_TKey key, void GHOST_NDOFManager::updateButton(GHOST_NDOF_ButtonT button, bool press, uint64_t time) { if (button == GHOST_NDOF_BUTTON_INVALID) { - CLOG_INFO(LOG, 2, "button=%d, press=%d (mapped to none, ignoring!)", int(button), int(press)); + CLOG_DEBUG(LOG, "button=%d, press=%d (mapped to none, ignoring!)", int(button), int(press)); return; } - CLOG_INFO( - LOG, 2, "button=%d, press=%d, name=%s", button, int(press), ndof_button_names.at(button)); + CLOG_DEBUG( + LOG, "button=%d, press=%d, name=%s", button, int(press), ndof_button_names.at(button)); #ifndef USE_3DCONNEXION_NONSTANDARD_KEYS if (((button >= GHOST_NDOF_BUTTON_KBP_F1) && (button <= GHOST_NDOF_BUTTON_KBP_F12)) || @@ -547,8 +547,7 @@ void GHOST_NDOFManager::updateButtonRAW(int button_number, bool press, uint64_t bitmask_devices_.end()) { if (button_number >= hid_map_button_num_) { - CLOG_INFO( - LOG, 2, "button=%d, press=%d (out of range, ignoring!)", button_number, int(press)); + CLOG_DEBUG(LOG, "button=%d, press=%d (out of range, ignoring!)", button_number, int(press)); return; } button = hid_map_[button_number]; @@ -651,7 +650,7 @@ void GHOST_NDOFManager::setDeadZone(float dz) motion_dead_zone_ = dz; /* Warn the rogue user/developer about high dead-zone, but allow it. */ - CLOG_INFO(LOG, 2, "dead zone set to %.2f%s", dz, (dz > 0.5f) ? " (unexpectedly high)" : ""); + CLOG_DEBUG(LOG, "dead zone set to %.2f%s", dz, (dz > 0.5f) ? " (unexpectedly high)" : ""); } static bool atHomePosition(const GHOST_TEventNDOFMotionData *ndof) @@ -732,7 +731,7 @@ bool GHOST_NDOFManager::sendMotionEvent() } else { /* Send no event and keep current state. */ - CLOG_INFO(LOG, 2, "motion ignored"); + CLOG_DEBUG(LOG, "motion ignored"); delete event; return false; } @@ -756,29 +755,27 @@ bool GHOST_NDOFManager::sendMotionEvent() } #if 1 - CLOG_INFO(LOG, - 2, - "motion sent, T=(%.2f,%.2f,%.2f), R=(%.2f,%.2f,%.2f) dt=%.3f, status=%s", - data->tx, - data->ty, - data->tz, - data->rx, - data->ry, - data->rz, - data->dt, - ndof_progress_string[data->progress]); + CLOG_DEBUG(LOG, + "motion sent, T=(%.2f,%.2f,%.2f), R=(%.2f,%.2f,%.2f) dt=%.3f, status=%s", + data->tx, + data->ty, + data->tz, + data->rx, + data->ry, + data->rz, + data->dt, + ndof_progress_string[data->progress]); #else /* Raw values, may be useful for debugging. */ - CLOG_INFO(LOG, - 2, - "motion sent, T=(%d,%d,%d) R=(%d,%d,%d) status=%s", - translation_[0], - translation_[1], - translation_[2], - rotation_[0], - rotation_[1], - rotation_[2], - ndof_progress_string[data->progress]); + CLOG_DEBUG(LOG, + "motion sent, T=(%d,%d,%d) R=(%d,%d,%d) status=%s", + translation_[0], + translation_[1], + translation_[2], + rotation_[0], + rotation_[1], + rotation_[2], + ndof_progress_string[data->progress]); #endif system_.pushEvent(event); diff --git a/intern/ghost/intern/GHOST_NDOFManagerUnix.cc b/intern/ghost/intern/GHOST_NDOFManagerUnix.cc index f24df77cb54..838d0af1059 100644 --- a/intern/ghost/intern/GHOST_NDOFManagerUnix.cc +++ b/intern/ghost/intern/GHOST_NDOFManagerUnix.cc @@ -21,10 +21,10 @@ GHOST_NDOFManagerUnix::GHOST_NDOFManagerUnix(GHOST_System &sys) : GHOST_NDOFManager(sys), available_(false) { if (access(spnav_sock_path, F_OK) != 0) { - CLOG_INFO(LOG, 1, "'spacenavd' not found at \"%s\"", spnav_sock_path); + CLOG_INFO(LOG, "'spacenavd' not found at \"%s\"", spnav_sock_path); } else if (spnav_open() != -1) { - CLOG_INFO(LOG, 1, "'spacenavd' found at\"%s\"", spnav_sock_path); + CLOG_INFO(LOG, "'spacenavd' found at\"%s\"", spnav_sock_path); available_ = true; /* determine exactly which device (if any) is plugged in */ diff --git a/intern/ghost/intern/GHOST_SystemWayland.cc b/intern/ghost/intern/GHOST_SystemWayland.cc index bee5d71f573..dbdbde2749c 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.cc +++ b/intern/ghost/intern/GHOST_SystemWayland.cc @@ -3045,7 +3045,7 @@ static void keyboard_depressed_state_push_events_from_change( seat->system->pushEvent_maybe_pending( new GHOST_EventKey(event_ms, GHOST_kEventKeyUp, win, gkey, false)); - CLOG_INFO(LOG, 2, "modifier (%d) up", i); + CLOG_DEBUG(LOG, "modifier (%d) up", i); } } @@ -3054,7 +3054,7 @@ static void keyboard_depressed_state_push_events_from_change( const GHOST_TKey gkey = GHOST_KEY_MODIFIER_FROM_INDEX(i); seat->system->pushEvent_maybe_pending( new GHOST_EventKey(event_ms, GHOST_kEventKeyDown, win, gkey, false)); - CLOG_INFO(LOG, 2, "modifier (%d) down", i); + CLOG_DEBUG(LOG, "modifier (%d) down", i); } } } @@ -3118,7 +3118,7 @@ static void relative_pointer_handle_relative_motion( const uint64_t event_ms = seat->system->ms_from_input_time(time); if (wl_surface *wl_surface_focus = seat->pointer.wl.surface_window) { - CLOG_INFO(LOG, 2, "relative_motion"); + CLOG_DEBUG(LOG, "relative_motion"); GHOST_WindowWayland *win = ghost_wl_surface_user_data(wl_surface_focus); const wl_fixed_t xy_next[2] = { seat->pointer.xy[0] + win->wl_fixed_from_window(dx), @@ -3127,7 +3127,7 @@ static void relative_pointer_handle_relative_motion( relative_pointer_handle_relative_motion_impl(seat, win, xy_next, event_ms); } else { - CLOG_INFO(LOG, 2, "relative_motion (skipped)"); + CLOG_DEBUG(LOG, "relative_motion (skipped)"); } } @@ -3241,7 +3241,7 @@ static void data_source_handle_target(void * /*data*/, wl_data_source * /*wl_data_source*/, const char * /*mime_type*/) { - CLOG_INFO(LOG, 2, "target"); + CLOG_DEBUG(LOG, "target"); } static void data_source_handle_send(void *data, @@ -3251,7 +3251,7 @@ static void data_source_handle_send(void *data, { GWL_Seat *seat = static_cast(data); - CLOG_INFO(LOG, 2, "send"); + CLOG_DEBUG(LOG, "send"); auto write_file_fn = [](GWL_Seat *seat, const int fd) { if (UNLIKELY(write(fd, @@ -3271,7 +3271,7 @@ static void data_source_handle_send(void *data, static void data_source_handle_cancelled(void *data, wl_data_source *wl_data_source) { - CLOG_INFO(LOG, 2, "cancelled"); + CLOG_DEBUG(LOG, "cancelled"); GWL_Seat *seat = static_cast(data); GWL_DataSource *data_source = seat->data_source; if (seat->data_source->wl.source == wl_data_source) { @@ -3291,7 +3291,7 @@ static void data_source_handle_cancelled(void *data, wl_data_source *wl_data_sou static void data_source_handle_dnd_drop_performed(void * /*data*/, wl_data_source * /*wl_data_source*/) { - CLOG_INFO(LOG, 2, "dnd_drop_performed"); + CLOG_DEBUG(LOG, "dnd_drop_performed"); } /** @@ -3303,7 +3303,7 @@ static void data_source_handle_dnd_drop_performed(void * /*data*/, */ static void data_source_handle_dnd_finished(void * /*data*/, wl_data_source * /*wl_data_source*/) { - CLOG_INFO(LOG, 2, "dnd_finished"); + CLOG_DEBUG(LOG, "dnd_finished"); } /** @@ -3317,7 +3317,7 @@ static void data_source_handle_action(void * /*data*/, wl_data_source * /*wl_data_source*/, const uint32_t dnd_action) { - CLOG_INFO(LOG, 2, "handle_action (dnd_action=%u)", dnd_action); + CLOG_DEBUG(LOG, "handle_action (dnd_action=%u)", dnd_action); } static const wl_data_source_listener data_source_listener = { @@ -3345,7 +3345,7 @@ static void data_offer_handle_offer(void *data, const char *mime_type) { /* NOTE: locking isn't needed as the #GWL_DataOffer wont have been assigned to the #GWL_Seat. */ - CLOG_INFO(LOG, 2, "offer (mime_type=%s)", mime_type); + CLOG_DEBUG(LOG, "offer (mime_type=%s)", mime_type); GWL_DataOffer *data_offer = static_cast(data); data_offer->types.insert(mime_type); } @@ -3355,7 +3355,7 @@ static void data_offer_handle_source_actions(void *data, const uint32_t source_actions) { /* NOTE: locking isn't needed as the #GWL_DataOffer wont have been assigned to the #GWL_Seat. */ - CLOG_INFO(LOG, 2, "source_actions (%u)", source_actions); + CLOG_DEBUG(LOG, "source_actions (%u)", source_actions); GWL_DataOffer *data_offer = static_cast(data); data_offer->dnd.source_actions = (enum wl_data_device_manager_dnd_action)source_actions; } @@ -3365,7 +3365,7 @@ static void data_offer_handle_action(void *data, const uint32_t dnd_action) { /* NOTE: locking isn't needed as the #GWL_DataOffer wont have been assigned to the #GWL_Seat. */ - CLOG_INFO(LOG, 2, "actions (%u)", dnd_action); + CLOG_DEBUG(LOG, "actions (%u)", dnd_action); GWL_DataOffer *data_offer = static_cast(data); data_offer->dnd.action = (enum wl_data_device_manager_dnd_action)dnd_action; } @@ -3391,7 +3391,7 @@ static void data_device_handle_data_offer(void * /*data*/, wl_data_device * /*wl_data_device*/, wl_data_offer *id) { - CLOG_INFO(LOG, 2, "data_offer"); + CLOG_DEBUG(LOG, "data_offer"); /* The ownership of data-offer isn't so obvious: * At this point it's not known if this will be used for drag & drop or selection. @@ -3432,12 +3432,12 @@ static void data_device_handle_enter(void *data, /* Handle the new offer. */ GWL_DataOffer *data_offer = static_cast(wl_data_offer_get_user_data(id)); if (!ghost_wl_surface_own_with_null_check(wl_surface)) { - CLOG_INFO(LOG, 2, "enter (skipped)"); + CLOG_DEBUG(LOG, "enter (skipped)"); wl_data_offer_destroy(data_offer->wl.id); delete data_offer; return; } - CLOG_INFO(LOG, 2, "enter"); + CLOG_DEBUG(LOG, "enter"); /* Transfer ownership of the `data_offer`. */ seat->data_offer_dnd = data_offer; @@ -3472,7 +3472,7 @@ static void data_device_handle_leave(void *data, wl_data_device * /*wl_data_devi if (seat->data_offer_dnd == nullptr) { return; } - CLOG_INFO(LOG, 2, "leave"); + CLOG_DEBUG(LOG, "leave"); dnd_events(seat, GHOST_kEventDraggingExited, event_ms); seat->wl.surface_window_focus_dnd = nullptr; @@ -3499,7 +3499,7 @@ static void data_device_handle_motion(void *data, return; } - CLOG_INFO(LOG, 2, "motion"); + CLOG_DEBUG(LOG, "motion"); seat->data_offer_dnd->dnd.xy[0] = x; seat->data_offer_dnd->dnd.xy[1] = y; @@ -3534,7 +3534,7 @@ static void data_device_handle_drop(void *data, wl_data_device * /*wl_data_devic } } - CLOG_INFO(LOG, 2, "drop mime_recieve=%s", mime_receive); + CLOG_DEBUG(LOG, "drop mime_recieve=%s", mime_receive); auto read_drop_data_fn = [](GWL_Seat *const seat, GWL_DataOffer *data_offer, @@ -3548,7 +3548,7 @@ static void data_device_handle_drop(void *data, wl_data_device * /*wl_data_devic const char *data_buf = read_buffer_from_data_offer( data_offer, mime_receive, nullptr, nil_terminate, &data_buf_len); - CLOG_INFO(LOG, 2, "read_drop_data mime_receive=%s, data_len=%zu", mime_receive, data_buf_len); + CLOG_DEBUG(LOG, "read_drop_data mime_receive=%s, data_len=%zu", mime_receive, data_buf_len); wl_data_offer_finish(data_offer->wl.id); wl_data_offer_destroy(data_offer->wl.id); @@ -3575,7 +3575,7 @@ static void data_device_handle_drop(void *data, wl_data_device * /*wl_data_devic GHOST_URL_decode_alloc(uris[i].data(), uris[i].size())); } - CLOG_INFO(LOG, 2, "read_drop_data file_count=%d", flist->count); + CLOG_DEBUG(LOG, "read_drop_data file_count=%d", flist->count); ghost_dnd_type = GHOST_kDragnDropTypeFilenames; ghost_dnd_data = flist; } @@ -3600,7 +3600,7 @@ static void data_device_handle_drop(void *data, wl_data_device * /*wl_data_devic wl_display_roundtrip(system->wl_display_get()); } else { - CLOG_INFO(LOG, 2, "read_drop_data, unhandled!"); + CLOG_DEBUG(LOG, "read_drop_data, unhandled!"); } free(const_cast(data_buf)); @@ -3631,11 +3631,11 @@ static void data_device_handle_selection(void *data, /* Handle the new offer. */ if (id == nullptr) { - CLOG_INFO(LOG, 2, "selection: (skipped)"); + CLOG_DEBUG(LOG, "selection: (skipped)"); return; } - CLOG_INFO(LOG, 2, "selection"); + CLOG_DEBUG(LOG, "selection"); GWL_DataOffer *data_offer = static_cast(wl_data_offer_get_user_data(id)); /* Transfer ownership of the `data_offer`. */ seat->data_offer_copy_paste = data_offer; @@ -3664,7 +3664,7 @@ static CLG_LogRef LOG_WL_CURSOR_BUFFER = {"ghost.wl.handle.cursor_buffer"}; static void cursor_buffer_handle_release(void *data, wl_buffer *wl_buffer) { - CLOG_INFO(LOG, 2, "release"); + CLOG_DEBUG(LOG, "release"); GWL_Cursor *cursor = static_cast(data); wl_buffer_destroy(wl_buffer); @@ -3748,10 +3748,10 @@ static bool update_cursor_scale(GWL_Cursor &cursor, static void cursor_surface_handle_enter(void *data, wl_surface *wl_surface, wl_output *wl_output) { if (!ghost_wl_output_own(wl_output)) { - CLOG_INFO(LOG, 2, "handle_enter (skipped)"); + CLOG_DEBUG(LOG, "handle_enter (skipped)"); return; } - CLOG_INFO(LOG, 2, "handle_enter"); + CLOG_DEBUG(LOG, "handle_enter"); GWL_Seat *seat = static_cast(data); GWL_SeatStatePointer *seat_state_pointer = gwl_seat_state_pointer_from_cursor_surface( @@ -3764,10 +3764,10 @@ static void cursor_surface_handle_enter(void *data, wl_surface *wl_surface, wl_o static void cursor_surface_handle_leave(void *data, wl_surface *wl_surface, wl_output *wl_output) { if (!(wl_output && ghost_wl_output_own(wl_output))) { - CLOG_INFO(LOG, 2, "handle_leave (skipped)"); + CLOG_DEBUG(LOG, "handle_leave (skipped)"); return; } - CLOG_INFO(LOG, 2, "handle_leave"); + CLOG_DEBUG(LOG, "handle_leave"); GWL_Seat *seat = static_cast(data); GWL_SeatStatePointer *seat_state_pointer = gwl_seat_state_pointer_from_cursor_surface( @@ -3782,7 +3782,7 @@ static void cursor_surface_handle_preferred_buffer_scale(void * /*data*/, int32_t factor) { /* Only available in interface version 6. */ - CLOG_INFO(LOG, 2, "handle_preferred_buffer_scale (factor=%d)", factor); + CLOG_DEBUG(LOG, "handle_preferred_buffer_scale (factor=%d)", factor); } #if defined(WL_SURFACE_PREFERRED_BUFFER_SCALE_SINCE_VERSION) && \ @@ -3792,7 +3792,7 @@ static void cursor_surface_handle_preferred_buffer_transform(void * /*data*/, uint32_t transform) { /* Only available in interface version 6. */ - CLOG_INFO(LOG, 2, "handle_preferred_buffer_transform (transform=%u)", transform); + CLOG_DEBUG(LOG, "handle_preferred_buffer_transform (transform=%u)", transform); } #endif /* WL_SURFACE_PREFERRED_BUFFER_SCALE_SINCE_VERSION && \ * WL_SURFACE_PREFERRED_BUFFER_TRANSFORM_SINCE_VERSION */ @@ -3830,10 +3830,10 @@ static void pointer_handle_enter(void *data, /* Null when just destroyed. */ if (!ghost_wl_surface_own_with_null_check(wl_surface)) { - CLOG_INFO(LOG, 2, "enter (skipped)"); + CLOG_DEBUG(LOG, "enter (skipped)"); return; } - CLOG_INFO(LOG, 2, "enter"); + CLOG_DEBUG(LOG, "enter"); GHOST_WindowWayland *win = ghost_wl_surface_user_data(wl_surface); @@ -3864,10 +3864,10 @@ static void pointer_handle_leave(void *data, /* First clear the `pointer.wl_surface`, since the window won't exist when closing the window. */ static_cast(data)->pointer.wl.surface_window = nullptr; if (!ghost_wl_surface_own_with_null_check(wl_surface)) { - CLOG_INFO(LOG, 2, "leave (skipped)"); + CLOG_DEBUG(LOG, "leave (skipped)"); return; } - CLOG_INFO(LOG, 2, "leave"); + CLOG_DEBUG(LOG, "leave"); } static void pointer_handle_motion(void *data, @@ -3882,7 +3882,7 @@ static void pointer_handle_motion(void *data, seat->pointer.xy[0] = surface_x; seat->pointer.xy[1] = surface_y; - CLOG_INFO(LOG, 2, "motion"); + CLOG_DEBUG(LOG, "motion"); gwl_pointer_handle_frame_event_add( &seat->pointer_events, GWL_Pointer_EventTypes::Motion, event_ms); @@ -3897,7 +3897,7 @@ static void pointer_handle_button(void *data, { GWL_Seat *seat = static_cast(data); - CLOG_INFO(LOG, 2, "button (button=%u, state=%u)", button, state); + CLOG_DEBUG(LOG, "button (button=%u, state=%u)", button, state); /* Always set the serial, even if the button event is not sent. */ seat->data_source_serial = serial; @@ -3939,7 +3939,7 @@ static void pointer_handle_axis(void *data, /* NOTE: this is used for touch based scrolling - or other input that doesn't scroll with * discrete "steps". This allows supporting smooth-scrolling without "touch" gesture support. */ - CLOG_INFO(LOG, 2, "axis (axis=%u, value=%d)", axis, value); + CLOG_DEBUG(LOG, "axis (axis=%u, value=%d)", axis, value); const int index = pointer_axis_as_index(axis); if (UNLIKELY(index == -1)) { return; @@ -3953,7 +3953,7 @@ static void pointer_handle_frame(void *data, wl_pointer * /*wl_pointer*/) { GWL_Seat *seat = static_cast(data); - CLOG_INFO(LOG, 2, "frame"); + CLOG_DEBUG(LOG, "frame"); if (wl_surface *wl_surface_focus = seat->pointer.wl.surface_window) { GHOST_WindowWayland *win = ghost_wl_surface_user_data(wl_surface_focus); @@ -4135,7 +4135,7 @@ static void pointer_handle_axis_source(void *data, wl_pointer * /*wl_pointer*/, uint32_t axis_source) { - CLOG_INFO(LOG, 2, "axis_source (axis_source=%u)", axis_source); + CLOG_DEBUG(LOG, "axis_source (axis_source=%u)", axis_source); GWL_Seat *seat = static_cast(data); seat->pointer_scroll.axis_source = (enum wl_pointer_axis_source)axis_source; } @@ -4158,7 +4158,7 @@ static void pointer_handle_axis_stop(void *data, smooth_as_discrete.smooth_xy_accum[1] = 0; } - CLOG_INFO(LOG, 2, "axis_stop (axis=%u)", axis); + CLOG_DEBUG(LOG, "axis_stop (axis=%u)", axis); } static void pointer_handle_axis_discrete(void *data, wl_pointer * /*wl_pointer*/, @@ -4167,7 +4167,7 @@ static void pointer_handle_axis_discrete(void *data, { /* NOTE: a discrete axis are typically mouse wheel events. * The non-discrete version of this function is used for touch-pad. */ - CLOG_INFO(LOG, 2, "axis_discrete (axis=%u, discrete=%d)", axis, discrete); + CLOG_DEBUG(LOG, "axis_discrete (axis=%u, discrete=%d)", axis, discrete); const int index = pointer_axis_as_index(axis); if (UNLIKELY(index == -1)) { return; @@ -4183,7 +4183,7 @@ static void pointer_handle_axis_value120(void *data, int32_t value120) { /* Only available in interface version 8. */ - CLOG_INFO(LOG, 2, "axis_value120 (axis=%u, value120=%d)", axis, value120); + CLOG_DEBUG(LOG, "axis_value120 (axis=%u, value120=%d)", axis, value120); const int index = pointer_axis_as_index(axis); if (UNLIKELY(index == -1)) { return; @@ -4200,7 +4200,7 @@ static void pointer_handle_axis_relative_direction(void *data, uint32_t direction) { /* Only available in interface version 9. */ - CLOG_INFO(LOG, 2, "axis_relative_direction (axis=%u, direction=%u)", axis, direction); + CLOG_DEBUG(LOG, "axis_relative_direction (axis=%u, direction=%u)", axis, direction); const int index = pointer_axis_as_index(axis); if (UNLIKELY(index == -1)) { return; @@ -4247,7 +4247,7 @@ static void gesture_hold_handle_begin( wl_surface * /*surface*/, uint32_t fingers) { - CLOG_INFO(LOG, 2, "begin (fingers=%u)", fingers); + CLOG_DEBUG(LOG, "begin (fingers=%u)", fingers); } static void gesture_hold_handle_end(void * /*data*/, @@ -4256,7 +4256,7 @@ static void gesture_hold_handle_end(void * /*data*/, uint32_t /*time*/, int32_t cancelled) { - CLOG_INFO(LOG, 2, "end (cancelled=%i)", cancelled); + CLOG_DEBUG(LOG, "end (cancelled=%i)", cancelled); } static const zwp_pointer_gesture_hold_v1_listener gesture_hold_listener = { @@ -4287,7 +4287,7 @@ static void gesture_pinch_handle_begin(void *data, GWL_Seat *seat = static_cast(data); (void)seat->system->ms_from_input_time(time); /* Only update internal time. */ - CLOG_INFO(LOG, 2, "begin (fingers=%u)", fingers); + CLOG_DEBUG(LOG, "begin (fingers=%u)", fingers); /* Reset defaults. */ seat->pointer_gesture_pinch = GWL_SeatStatePointerGesture_Pinch{}; @@ -4345,13 +4345,12 @@ static void gesture_pinch_handle_update(void *data, GWL_Seat *seat = static_cast(data); const uint64_t event_ms = seat->system->ms_from_input_time(time); - CLOG_INFO(LOG, - 2, - "update (dx=%.3f, dy=%.3f, scale=%.3f, rotation=%.3f)", - wl_fixed_to_double(dx), - wl_fixed_to_double(dy), - wl_fixed_to_double(scale), - wl_fixed_to_double(rotation)); + CLOG_DEBUG(LOG, + "update (dx=%.3f, dy=%.3f, scale=%.3f, rotation=%.3f)", + wl_fixed_to_double(dx), + wl_fixed_to_double(dy), + wl_fixed_to_double(scale), + wl_fixed_to_double(rotation)); GHOST_WindowWayland *win = nullptr; @@ -4404,7 +4403,7 @@ static void gesture_pinch_handle_end(void *data, GWL_Seat *seat = static_cast(data); (void)seat->system->ms_from_input_time(time); /* Only update internal time. */ - CLOG_INFO(LOG, 2, "end (cancelled=%i)", cancelled); + CLOG_DEBUG(LOG, "end (cancelled=%i)", cancelled); } static const zwp_pointer_gesture_pinch_v1_listener gesture_pinch_listener = { @@ -4439,7 +4438,7 @@ static void gesture_swipe_handle_begin( wl_surface * /*surface*/, uint32_t fingers) { - CLOG_INFO(LOG, 2, "begin (fingers=%u)", fingers); + CLOG_DEBUG(LOG, "begin (fingers=%u)", fingers); } static void gesture_swipe_handle_update( @@ -4449,7 +4448,7 @@ static void gesture_swipe_handle_update( wl_fixed_t dx, wl_fixed_t dy) { - CLOG_INFO(LOG, 2, "update (dx=%.3f, dy=%.3f)", wl_fixed_to_double(dx), wl_fixed_to_double(dy)); + CLOG_DEBUG(LOG, "update (dx=%.3f, dy=%.3f)", wl_fixed_to_double(dx), wl_fixed_to_double(dy)); } static void gesture_swipe_handle_end( @@ -4459,7 +4458,7 @@ static void gesture_swipe_handle_end( uint32_t /*time*/, int32_t cancelled) { - CLOG_INFO(LOG, 2, "end (cancelled=%i)", cancelled); + CLOG_DEBUG(LOG, "end (cancelled=%i)", cancelled); } static const zwp_pointer_gesture_swipe_v1_listener gesture_swipe_listener = { @@ -4493,7 +4492,7 @@ static void touch_seat_handle_down(void * /*data*/, wl_fixed_t /*x*/, wl_fixed_t /*y*/) { - CLOG_INFO(LOG, 2, "down"); + CLOG_DEBUG(LOG, "down"); } static void touch_seat_handle_up(void * /*data*/, @@ -4502,7 +4501,7 @@ static void touch_seat_handle_up(void * /*data*/, uint32_t /*time*/, int32_t /*id*/) { - CLOG_INFO(LOG, 2, "up"); + CLOG_DEBUG(LOG, "up"); } static void touch_seat_handle_motion(void * /*data*/, @@ -4512,18 +4511,18 @@ static void touch_seat_handle_motion(void * /*data*/, wl_fixed_t /*x*/, wl_fixed_t /*y*/) { - CLOG_INFO(LOG, 2, "motion"); + CLOG_DEBUG(LOG, "motion"); } static void touch_seat_handle_frame(void * /*data*/, wl_touch * /*wl_touch*/) { - CLOG_INFO(LOG, 2, "frame"); + CLOG_DEBUG(LOG, "frame"); } static void touch_seat_handle_cancel(void * /*data*/, wl_touch * /*wl_touch*/) { - CLOG_INFO(LOG, 2, "cancel"); + CLOG_DEBUG(LOG, "cancel"); } static void touch_seat_handle_shape(void * /*data*/, @@ -4532,7 +4531,7 @@ static void touch_seat_handle_shape(void * /*data*/, wl_fixed_t /*major*/, wl_fixed_t /*minor*/) { - CLOG_INFO(LOG, 2, "shape"); + CLOG_DEBUG(LOG, "shape"); } static void touch_seat_handle_orientation(void * /*data*/, @@ -4540,7 +4539,7 @@ static void touch_seat_handle_orientation(void * /*data*/, int32_t /*id*/, wl_fixed_t /*orientation*/) { - CLOG_INFO(LOG, 2, "orientation"); + CLOG_DEBUG(LOG, "orientation"); } static const wl_touch_listener touch_seat_listener = { @@ -4568,7 +4567,7 @@ static void tablet_tool_handle_type(void *data, zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/, const uint32_t tool_type) { - CLOG_INFO(LOG, 2, "type (type=%u)", tool_type); + CLOG_DEBUG(LOG, "type (type=%u)", tool_type); GWL_TabletTool *tablet_tool = static_cast(data); @@ -4580,7 +4579,7 @@ static void tablet_tool_handle_hardware_serial(void * /*data*/, const uint32_t /*hardware_serial_hi*/, const uint32_t /*hardware_serial_lo*/) { - CLOG_INFO(LOG, 2, "hardware_serial"); + CLOG_DEBUG(LOG, "hardware_serial"); } static void tablet_tool_handle_hardware_id_wacom(void * /*data*/, @@ -4588,30 +4587,29 @@ static void tablet_tool_handle_hardware_id_wacom(void * /*data*/, const uint32_t /*hardware_id_hi*/, const uint32_t /*hardware_id_lo*/) { - CLOG_INFO(LOG, 2, "hardware_id_wacom"); + CLOG_DEBUG(LOG, "hardware_id_wacom"); } static void tablet_tool_handle_capability(void * /*data*/, zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/, const uint32_t capability) { - CLOG_INFO(LOG, - 2, - "capability (tilt=%d, distance=%d, rotation=%d, slider=%d, wheel=%d)", - (capability & ZWP_TABLET_TOOL_V2_CAPABILITY_TILT) != 0, - (capability & ZWP_TABLET_TOOL_V2_CAPABILITY_DISTANCE) != 0, - (capability & ZWP_TABLET_TOOL_V2_CAPABILITY_ROTATION) != 0, - (capability & ZWP_TABLET_TOOL_V2_CAPABILITY_SLIDER) != 0, - (capability & ZWP_TABLET_TOOL_V2_CAPABILITY_WHEEL) != 0); + CLOG_DEBUG(LOG, + "capability (tilt=%d, distance=%d, rotation=%d, slider=%d, wheel=%d)", + (capability & ZWP_TABLET_TOOL_V2_CAPABILITY_TILT) != 0, + (capability & ZWP_TABLET_TOOL_V2_CAPABILITY_DISTANCE) != 0, + (capability & ZWP_TABLET_TOOL_V2_CAPABILITY_ROTATION) != 0, + (capability & ZWP_TABLET_TOOL_V2_CAPABILITY_SLIDER) != 0, + (capability & ZWP_TABLET_TOOL_V2_CAPABILITY_WHEEL) != 0); } static void tablet_tool_handle_done(void * /*data*/, zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/) { - CLOG_INFO(LOG, 2, "done"); + CLOG_DEBUG(LOG, "done"); } static void tablet_tool_handle_removed(void *data, zwp_tablet_tool_v2 *zwp_tablet_tool_v2) { - CLOG_INFO(LOG, 2, "removed"); + CLOG_DEBUG(LOG, "removed"); GWL_TabletTool *tablet_tool = static_cast(data); GWL_Seat *seat = tablet_tool->seat; @@ -4633,10 +4631,10 @@ static void tablet_tool_handle_proximity_in(void *data, wl_surface *wl_surface) { if (!ghost_wl_surface_own_with_null_check(wl_surface)) { - CLOG_INFO(LOG, 2, "proximity_in (skipped)"); + CLOG_DEBUG(LOG, "proximity_in (skipped)"); return; } - CLOG_INFO(LOG, 2, "proximity_in"); + CLOG_DEBUG(LOG, "proximity_in"); GWL_TabletTool *tablet_tool = static_cast(data); tablet_tool->proximity = true; @@ -4665,7 +4663,7 @@ static void tablet_tool_handle_proximity_in(void *data, static void tablet_tool_handle_proximity_out(void *data, zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/) { - CLOG_INFO(LOG, 2, "proximity_out"); + CLOG_DEBUG(LOG, "proximity_out"); GWL_TabletTool *tablet_tool = static_cast(data); /* Defer clearing the wl_surface until the frame is handled. * Without this, the frame can not access the wl_surface. */ @@ -4680,7 +4678,7 @@ static void tablet_tool_handle_down(void *data, GWL_TabletTool *tablet_tool = static_cast(data); GWL_Seat *seat = tablet_tool->seat; - CLOG_INFO(LOG, 2, "down"); + CLOG_DEBUG(LOG, "down"); seat->data_source_serial = serial; @@ -4691,7 +4689,7 @@ static void tablet_tool_handle_up(void *data, zwp_tablet_tool_v2 * /*zwp_tablet_ { GWL_TabletTool *tablet_tool = static_cast(data); - CLOG_INFO(LOG, 2, "up"); + CLOG_DEBUG(LOG, "up"); gwl_tablet_tool_frame_event_add(tablet_tool, GWL_TabletTool_EventTypes::Stylus0_Up); } @@ -4703,7 +4701,7 @@ static void tablet_tool_handle_motion(void *data, { GWL_TabletTool *tablet_tool = static_cast(data); - CLOG_INFO(LOG, 2, "motion"); + CLOG_DEBUG(LOG, "motion"); tablet_tool->xy[0] = x; tablet_tool->xy[1] = y; @@ -4717,7 +4715,7 @@ static void tablet_tool_handle_pressure(void *data, const uint32_t pressure) { const float pressure_unit = float(pressure) / 65535; - CLOG_INFO(LOG, 2, "pressure (%.4f)", pressure_unit); + CLOG_DEBUG(LOG, "pressure (%.4f)", pressure_unit); GWL_TabletTool *tablet_tool = static_cast(data); GHOST_TabletData &td = tablet_tool->data; @@ -4730,7 +4728,7 @@ static void tablet_tool_handle_distance(void * /*data*/, zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/, const uint32_t distance) { - CLOG_INFO(LOG, 2, "distance (distance=%u)", distance); + CLOG_DEBUG(LOG, "distance (distance=%u)", distance); } static void tablet_tool_handle_tilt(void *data, @@ -4744,7 +4742,7 @@ static void tablet_tool_handle_tilt(void *data, float(wl_fixed_to_double(tilt_x) / 90.0f), float(wl_fixed_to_double(tilt_y) / 90.0f), }; - CLOG_INFO(LOG, 2, "tilt (x=%.4f, y=%.4f)", UNPACK2(tilt_unit)); + CLOG_DEBUG(LOG, "tilt (x=%.4f, y=%.4f)", UNPACK2(tilt_unit)); GWL_TabletTool *tablet_tool = static_cast(data); GHOST_TabletData &td = tablet_tool->data; td.Xtilt = std::clamp(tilt_unit[0], -1.0f, 1.0f); @@ -4757,14 +4755,14 @@ static void tablet_tool_handle_rotation(void * /*data*/, zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/, const wl_fixed_t degrees) { - CLOG_INFO(LOG, 2, "rotation (degrees=%.4f)", wl_fixed_to_double(degrees)); + CLOG_DEBUG(LOG, "rotation (degrees=%.4f)", wl_fixed_to_double(degrees)); } static void tablet_tool_handle_slider(void * /*data*/, zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/, const int32_t position) { - CLOG_INFO(LOG, 2, "slider (position=%d)", position); + CLOG_DEBUG(LOG, "slider (position=%d)", position); } static void tablet_tool_handle_wheel(void *data, zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/, @@ -4777,7 +4775,7 @@ static void tablet_tool_handle_wheel(void *data, GWL_TabletTool *tablet_tool = static_cast(data); - CLOG_INFO(LOG, 2, "wheel (clicks=%d)", clicks); + CLOG_DEBUG(LOG, "wheel (clicks=%d)", clicks); tablet_tool->frame_pending.wheel.clicks = clicks; @@ -4793,7 +4791,7 @@ static void tablet_tool_handle_button(void *data, GWL_TabletTool *tablet_tool = static_cast(data); GWL_Seat *seat = tablet_tool->seat; - CLOG_INFO(LOG, 2, "button (button=%u, state=%u)", button, state); + CLOG_DEBUG(LOG, "button (button=%u, state=%u)", button, state); bool is_press = false; switch (state) { @@ -4838,7 +4836,7 @@ static void tablet_tool_handle_frame(void *data, GWL_Seat *seat = tablet_tool->seat; const uint64_t event_ms = seat->system->ms_from_input_time(time); - CLOG_INFO(LOG, 2, "frame"); + CLOG_DEBUG(LOG, "frame"); /* No need to check the surfaces origin, it's already known to be owned by GHOST. */ if (wl_surface *wl_surface_focus = seat->tablet.wl.surface_window) { @@ -4954,14 +4952,14 @@ static void tablet_seat_handle_tablet_added(void * /*data*/, zwp_tablet_seat_v2 * /*zwp_tablet_seat_v2*/, zwp_tablet_v2 *id) { - CLOG_INFO(LOG, 2, "tablet_added (id=%p)", id); + CLOG_DEBUG(LOG, "tablet_added (id=%p)", id); } static void tablet_seat_handle_tool_added(void *data, zwp_tablet_seat_v2 * /*zwp_tablet_seat_v2*/, zwp_tablet_tool_v2 *id) { - CLOG_INFO(LOG, 2, "tool_added (id=%p)", id); + CLOG_DEBUG(LOG, "tool_added (id=%p)", id); GWL_Seat *seat = static_cast(data); GWL_TabletTool *tablet_tool = new GWL_TabletTool(); @@ -4983,7 +4981,7 @@ static void tablet_seat_handle_pad_added(void * /*data*/, zwp_tablet_seat_v2 * /*zwp_tablet_seat_v2*/, zwp_tablet_pad_v2 *id) { - CLOG_INFO(LOG, 2, "pad_added (id=%p)", id); + CLOG_DEBUG(LOG, "pad_added (id=%p)", id); } static const zwp_tablet_seat_v2_listener tablet_seat_listener = { @@ -5012,7 +5010,7 @@ static void keyboard_handle_keymap(void *data, GWL_Seat *seat = static_cast(data); if ((!data) || (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1)) { - CLOG_INFO(LOG, 2, "keymap (no data or wrong version)"); + CLOG_DEBUG(LOG, "keymap (no data or wrong version)"); close(fd); return; } @@ -5020,7 +5018,7 @@ static void keyboard_handle_keymap(void *data, char *map_str = static_cast(mmap(nullptr, size, PROT_READ, MAP_PRIVATE, fd, 0)); if (map_str == MAP_FAILED) { close(fd); - CLOG_INFO(LOG, 2, "keymap mmap failed: %s", std::strerror(errno)); + CLOG_DEBUG(LOG, "keymap mmap failed: %s", std::strerror(errno)); return; } @@ -5030,11 +5028,11 @@ static void keyboard_handle_keymap(void *data, close(fd); if (!keymap) { - CLOG_INFO(LOG, 2, "keymap (not found)"); + CLOG_DEBUG(LOG, "keymap (not found)"); return; } - CLOG_INFO(LOG, 2, "keymap"); + CLOG_DEBUG(LOG, "keymap"); /* Reset in case there was a previous non-zero active layout for the last key-map. * Note that this is set later by `wl_keyboard_listener::modifiers`, it's possible that handling @@ -5116,10 +5114,10 @@ static void keyboard_handle_enter(void *data, { /* Null when just destroyed. */ if (!ghost_wl_surface_own_with_null_check(wl_surface)) { - CLOG_INFO(LOG, 2, "enter (skipped)"); + CLOG_DEBUG(LOG, "enter (skipped)"); return; } - CLOG_INFO(LOG, 2, "enter"); + CLOG_DEBUG(LOG, "enter"); GWL_Seat *seat = static_cast(data); GHOST_IWindow *win = ghost_wl_surface_user_data(wl_surface); @@ -5144,7 +5142,7 @@ static void keyboard_handle_enter(void *data, uint32_t *key; WL_ARRAY_FOR_EACH (key, keys) { const xkb_keycode_t key_code = *key + EVDEV_OFFSET; - CLOG_INFO(LOG, 2, "enter (key_held=%d)", int(key_code)); + CLOG_DEBUG(LOG, "enter (key_held=%d)", int(key_code)); const xkb_keysym_t sym = xkb_state_key_get_one_sym(seat->xkb.state, key_code); const GHOST_TKey gkey = xkb_map_gkey_or_scan_code(sym, *key); if (gkey != GHOST_kKeyUnknown) { @@ -5198,10 +5196,10 @@ static void keyboard_handle_leave(void *data, wl_surface *wl_surface) { if (!ghost_wl_surface_own_with_null_check(wl_surface)) { - CLOG_INFO(LOG, 2, "leave (skipped)"); + CLOG_DEBUG(LOG, "leave (skipped)"); return; } - CLOG_INFO(LOG, 2, "leave"); + CLOG_DEBUG(LOG, "leave"); GWL_Seat *seat = static_cast(data); seat->keyboard.wl.surface_window = nullptr; @@ -5377,10 +5375,10 @@ static void keyboard_handle_key(void *data, #endif key_code); if (sym == XKB_KEY_NoSymbol) { - CLOG_INFO(LOG, 2, "key (code=%d, state=%u, no symbol, skipped)", int(key_code), state); + CLOG_DEBUG(LOG, "key (code=%d, state=%u, no symbol, skipped)", int(key_code), state); return; } - CLOG_INFO(LOG, 2, "key (code=%d, state=%u)", int(key_code), state); + CLOG_DEBUG(LOG, "key (code=%d, state=%u)", int(key_code), state); GHOST_TEventType etype = GHOST_kEventUnknown; switch (state) { @@ -5500,13 +5498,12 @@ static void keyboard_handle_modifiers(void *data, const uint32_t mods_locked, const uint32_t group) { - CLOG_INFO(LOG, - 2, - "modifiers (depressed=%u, latched=%u, locked=%u, group=%u)", - mods_depressed, - mods_latched, - mods_locked, - group); + CLOG_DEBUG(LOG, + "modifiers (depressed=%u, latched=%u, locked=%u, group=%u)", + mods_depressed, + mods_latched, + mods_locked, + group); GWL_Seat *seat = static_cast(data); xkb_state_update_mask(seat->xkb.state, mods_depressed, mods_latched, mods_locked, 0, 0, group); @@ -5537,7 +5534,7 @@ static void keyboard_handle_repeat_info(void *data, const int32_t rate, const int32_t delay) { - CLOG_INFO(LOG, 2, "info (rate=%d, delay=%d)", rate, delay); + CLOG_DEBUG(LOG, "info (rate=%d, delay=%d)", rate, delay); GWL_Seat *seat = static_cast(data); seat->key_repeat.rate = rate; @@ -5581,7 +5578,7 @@ static void primary_selection_offer_offer(void *data, /* NOTE: locking isn't needed as the #GWL_DataOffer wont have been assigned to the #GWL_Seat. */ GWL_PrimarySelection_DataOffer *data_offer = static_cast(data); if (data_offer->wp.id != id) { - CLOG_INFO(LOG, 2, "offer: %p: offer for unknown selection %p of %s (skipped)", data, id, type); + CLOG_DEBUG(LOG, "offer: %p: offer for unknown selection %p of %s (skipped)", data, id, type); return; } @@ -5608,7 +5605,7 @@ static void primary_selection_device_handle_data_offer( zwp_primary_selection_device_v1 * /*zwp_primary_selection_device_v1*/, zwp_primary_selection_offer_v1 *id) { - CLOG_INFO(LOG, 2, "data_offer"); + CLOG_DEBUG(LOG, "data_offer"); GWL_PrimarySelection_DataOffer *data_offer = new GWL_PrimarySelection_DataOffer; data_offer->wp.id = id; @@ -5630,10 +5627,10 @@ static void primary_selection_device_handle_selection( } if (id == nullptr) { - CLOG_INFO(LOG, 2, "selection: (skipped)"); + CLOG_DEBUG(LOG, "selection: (skipped)"); return; } - CLOG_INFO(LOG, 2, "selection"); + CLOG_DEBUG(LOG, "selection"); /* Transfer ownership of the `data_offer`. */ GWL_PrimarySelection_DataOffer *data_offer = static_cast( zwp_primary_selection_offer_v1_get_user_data(id)); @@ -5661,7 +5658,7 @@ static void primary_selection_source_send(void *data, const char * /*mime_type*/, int32_t fd) { - CLOG_INFO(LOG, 2, "send"); + CLOG_DEBUG(LOG, "send"); GWL_PrimarySelection *primary = static_cast(data); @@ -5683,7 +5680,7 @@ static void primary_selection_source_send(void *data, static void primary_selection_source_cancelled(void *data, zwp_primary_selection_source_v1 *source) { - CLOG_INFO(LOG, 2, "cancelled"); + CLOG_DEBUG(LOG, "cancelled"); GWL_PrimarySelection *primary = static_cast(data); @@ -5741,7 +5738,7 @@ static void text_input_handle_enter(void *data, if (!ghost_wl_surface_own(surface)) { return; } - CLOG_INFO(LOG, 2, "enter"); + CLOG_DEBUG(LOG, "enter"); GWL_Seat *seat = static_cast(data); seat->ime.surface_window = surface; /* If text input is enabled, should call `enable` after receive `enter` event. @@ -5760,7 +5757,7 @@ static void text_input_handle_leave(void *data, if (!ghost_wl_surface_own_with_null_check(surface)) { return; } - CLOG_INFO(LOG, 2, "leave"); + CLOG_DEBUG(LOG, "leave"); GWL_Seat *seat = static_cast(data); if (seat->ime.surface_window == surface) { seat->ime.surface_window = nullptr; @@ -5776,12 +5773,11 @@ static void text_input_handle_preedit_string(void *data, int32_t cursor_begin, int32_t cursor_end) { - CLOG_INFO(LOG, - 2, - "preedit_string (text=\"%s\", cursor_begin=%d, cursor_end=%d)", - text ? text : "", - cursor_begin, - cursor_end); + CLOG_DEBUG(LOG, + "preedit_string (text=\"%s\", cursor_begin=%d, cursor_end=%d)", + text ? text : "", + cursor_begin, + cursor_end); GWL_Seat *seat = static_cast(data); if (seat->ime.has_preedit == false) { @@ -5805,7 +5801,7 @@ static void text_input_handle_commit_string(void *data, zwp_text_input_v3 * /*zwp_text_input_v3*/, const char *text) { - CLOG_INFO(LOG, 2, "commit_string (text=\"%s\")", text ? text : ""); + CLOG_DEBUG(LOG, "commit_string (text=\"%s\")", text ? text : ""); GWL_Seat *seat = static_cast(data); seat->ime.result_is_null = (text == nullptr); @@ -5820,11 +5816,10 @@ static void text_input_handle_delete_surrounding_text(void * /*data*/, uint32_t before_length, uint32_t after_length) { - CLOG_INFO(LOG, - 2, - "delete_surrounding_text (before_length=%u, after_length=%u)", - before_length, - after_length); + CLOG_DEBUG(LOG, + "delete_surrounding_text (before_length=%u, after_length=%u)", + before_length, + after_length); /* NOTE: Currently unused, do we care about this event? * SDL ignores this event. */ @@ -5838,7 +5833,7 @@ static void text_input_handle_done(void *data, GHOST_SystemWayland *system = seat->system; const uint64_t event_ms = seat->system->getMilliSeconds(); - CLOG_INFO(LOG, 2, "done"); + CLOG_DEBUG(LOG, "done"); GHOST_WindowWayland *win = seat->ime.surface_window ? ghost_wl_surface_user_data(seat->ime.surface_window) : @@ -6147,12 +6142,11 @@ static void seat_handle_capabilities(void *data, [[maybe_unused]] wl_seat *wl_seat, const uint32_t capabilities) { - CLOG_INFO(LOG, - 2, - "capabilities (pointer=%d, keyboard=%d, touch=%d)", - (capabilities & WL_SEAT_CAPABILITY_POINTER) != 0, - (capabilities & WL_SEAT_CAPABILITY_KEYBOARD) != 0, - (capabilities & WL_SEAT_CAPABILITY_TOUCH) != 0); + CLOG_DEBUG(LOG, + "capabilities (pointer=%d, keyboard=%d, touch=%d)", + (capabilities & WL_SEAT_CAPABILITY_POINTER) != 0, + (capabilities & WL_SEAT_CAPABILITY_KEYBOARD) != 0, + (capabilities & WL_SEAT_CAPABILITY_TOUCH) != 0); GWL_Seat *seat = static_cast(data); GHOST_ASSERT(seat->wl.seat == wl_seat, "Seat mismatch"); @@ -6181,7 +6175,7 @@ static void seat_handle_capabilities(void *data, static void seat_handle_name(void *data, wl_seat * /*wl_seat*/, const char *name) { - CLOG_INFO(LOG, 2, "name (name=\"%s\")", name); + CLOG_DEBUG(LOG, "name (name=\"%s\")", name); static_cast(data)->name = std::string(name); } @@ -6206,7 +6200,7 @@ static void xdg_output_handle_logical_position(void *data, const int32_t x, const int32_t y) { - CLOG_INFO(LOG, 2, "logical_position [%d, %d]", x, y); + CLOG_DEBUG(LOG, "logical_position [%d, %d]", x, y); GWL_Output *output = static_cast(data); output->position_logical[0] = x; @@ -6219,7 +6213,7 @@ static void xdg_output_handle_logical_size(void *data, const int32_t width, const int32_t height) { - CLOG_INFO(LOG, 2, "logical_size [%d, %d]", width, height); + CLOG_DEBUG(LOG, "logical_size [%d, %d]", width, height); GWL_Output *output = static_cast(data); if (output->size_native[0] != 0 && output->size_native[1] != 0) { @@ -6251,7 +6245,7 @@ static void xdg_output_handle_logical_size(void *data, static void xdg_output_handle_done(void *data, zxdg_output_v1 * /*xdg_output*/) { - CLOG_INFO(LOG, 2, "done"); + CLOG_DEBUG(LOG, "done"); /* NOTE: `xdg-output.done` events are deprecated and only apply below version 3 of the protocol. * `wl-output.done` event will be emitted in version 3 or higher. */ GWL_Output *output = static_cast(data); @@ -6264,14 +6258,14 @@ static void xdg_output_handle_name(void * /*data*/, zxdg_output_v1 * /*xdg_output*/, const char *name) { - CLOG_INFO(LOG, 2, "name (name=\"%s\")", name); + CLOG_DEBUG(LOG, "name (name=\"%s\")", name); } static void xdg_output_handle_description(void * /*data*/, zxdg_output_v1 * /*xdg_output*/, const char *description) { - CLOG_INFO(LOG, 2, "description (description=\"%s\")", description); + CLOG_DEBUG(LOG, "description (description=\"%s\")", description); } static const zxdg_output_v1_listener xdg_output_listener = { @@ -6304,14 +6298,13 @@ static void output_handle_geometry(void *data, const char *model, const int32_t transform) { - CLOG_INFO(LOG, - 2, - "geometry (make=\"%s\", model=\"%s\", transform=%d, size=[%d, %d])", - make, - model, - transform, - physical_width, - physical_height); + CLOG_DEBUG(LOG, + "geometry (make=\"%s\", model=\"%s\", transform=%d, size=[%d, %d])", + make, + model, + transform, + physical_width, + physical_height); GWL_Output *output = static_cast(data); output->transform = transform; @@ -6329,10 +6322,10 @@ static void output_handle_mode(void *data, const int32_t /*refresh*/) { if ((flags & WL_OUTPUT_MODE_CURRENT) == 0) { - CLOG_INFO(LOG, 2, "mode (skipped)"); + CLOG_DEBUG(LOG, "mode (skipped)"); return; } - CLOG_INFO(LOG, 2, "mode (size=[%d, %d], flags=%u)", width, height, flags); + CLOG_DEBUG(LOG, "mode (size=[%d, %d], flags=%u)", width, height, flags); GWL_Output *output = static_cast(data); output->size_native[0] = width; @@ -6349,7 +6342,7 @@ static void output_handle_mode(void *data, */ static void output_handle_done(void *data, wl_output * /*wl_output*/) { - CLOG_INFO(LOG, 2, "done"); + CLOG_DEBUG(LOG, "done"); GWL_Output *output = static_cast(data); int32_t size_native[2] = {UNPACK2(output->size_native)}; @@ -6373,7 +6366,7 @@ static void output_handle_done(void *data, wl_output * /*wl_output*/) static void output_handle_scale(void *data, wl_output * /*wl_output*/, const int32_t factor) { - CLOG_INFO(LOG, 2, "scale"); + CLOG_DEBUG(LOG, "scale"); GWL_Output *output = static_cast(data); output->scale = factor; output->system->output_scale_update(output); @@ -6382,14 +6375,14 @@ static void output_handle_scale(void *data, wl_output * /*wl_output*/, const int static void output_handle_name(void * /*data*/, wl_output * /*wl_output*/, const char *name) { /* Only available in interface version 4. */ - CLOG_INFO(LOG, 2, "name (%s)", name); + CLOG_DEBUG(LOG, "name (%s)", name); } static void output_handle_description(void * /*data*/, wl_output * /*wl_output*/, const char *description) { /* Only available in interface version 4. */ - CLOG_INFO(LOG, 2, "description (%s)", description); + CLOG_DEBUG(LOG, "description (%s)", description); } static const wl_output_listener output_listener = { @@ -6414,7 +6407,7 @@ static CLG_LogRef LOG_WL_XDG_WM_BASE = {"ghost.wl.handle.xdg_wm_base"}; static void shell_handle_ping(void * /*data*/, xdg_wm_base *xdg_wm_base, const uint32_t serial) { - CLOG_INFO(LOG, 2, "ping"); + CLOG_DEBUG(LOG, "ping"); xdg_wm_base_pong(xdg_wm_base, serial); } @@ -6439,7 +6432,7 @@ static void decor_handle_error(libdecor * /*context*/, enum libdecor_error error, const char *message) { - CLOG_INFO(LOG, 2, "error (id=%d, message=%s)", error, message); + CLOG_DEBUG(LOG, "error (id=%d, message=%s)", error, message); (void)(error); (void)(message); @@ -7274,13 +7267,12 @@ static void global_handle_add(void *data, added = display->registry_entry != registry_entry_prev; } - CLOG_INFO(LOG, - 2, - "add %s(interface=%s, version=%u, name=%u)", - (interface_slot != -1) ? (added ? "" : "(found but not added)") : "(skipped), ", - interface, - version, - name); + CLOG_DEBUG(LOG, + "add %s(interface=%s, version=%u, name=%u)", + (interface_slot != -1) ? (added ? "" : "(found but not added)") : "(skipped), ", + interface, + version, + name); /* Initialization avoids excessive calls by calling update after all have been initialized. */ if (added) { @@ -7310,11 +7302,10 @@ static void global_handle_remove(void *data, int interface_slot = 0; const bool removed = gwl_registry_entry_remove_by_name(display, name, &interface_slot); - CLOG_INFO(LOG, - 2, - "remove (name=%u, interface=%s)", - name, - removed ? *gwl_registry_handlers[interface_slot].interface_p : "(unknown)"); + CLOG_DEBUG(LOG, + "remove (name=%u, interface=%s)", + name, + removed ? *gwl_registry_handlers[interface_slot].interface_p : "(unknown)"); if (removed) { if (display->registry_skip_update_all == false) { diff --git a/intern/ghost/intern/GHOST_WindowWayland.cc b/intern/ghost/intern/GHOST_WindowWayland.cc index d8dba322baa..e7ed3273fe3 100644 --- a/intern/ghost/intern/GHOST_WindowWayland.cc +++ b/intern/ghost/intern/GHOST_WindowWayland.cc @@ -1271,7 +1271,7 @@ static void xdg_toplevel_handle_configure(void *data, wl_array *states) { /* TODO: log `states`, not urgent. */ - CLOG_INFO(LOG, 2, "configure (size=[%d, %d])", width, height); + CLOG_DEBUG(LOG, "configure (size=[%d, %d])", width, height); GWL_Window *win = static_cast(data); @@ -1314,7 +1314,7 @@ static void xdg_toplevel_handle_configure(void *data, static void xdg_toplevel_handle_close(void *data, xdg_toplevel * /*xdg_toplevel*/) { - CLOG_INFO(LOG, 2, "close"); + CLOG_DEBUG(LOG, "close"); GWL_Window *win = static_cast(data); @@ -1327,7 +1327,7 @@ static void xdg_toplevel_handle_configure_bounds(void *data, int32_t height) { /* Only available in interface version 4. */ - CLOG_INFO(LOG, 2, "configure_bounds (size=[%d, %d])", width, height); + CLOG_DEBUG(LOG, "configure_bounds (size=[%d, %d])", width, height); /* No need to lock as this only runs on window creation. */ GWL_Window *win = static_cast(data); @@ -1342,7 +1342,7 @@ static void xdg_toplevel_handle_wm_capabilities(void * /*data*/, wl_array * /*capabilities*/) { /* Only available in interface version 5. */ - CLOG_INFO(LOG, 2, "wm_capabilities"); + CLOG_DEBUG(LOG, "wm_capabilities"); /* NOTE: this would be useful if blender had CSD. */ } @@ -1406,10 +1406,9 @@ static void wp_fractional_scale_handle_preferred_scale( #ifdef USE_EVENT_BACKGROUND_THREAD std::lock_guard lock_frame_guard{static_cast(data)->frame_pending_mutex}; #endif - CLOG_INFO(LOG, - 2, - "preferred_scale (preferred_scale=%.6f)", - double(preferred_scale) / FRACTIONAL_DENOMINATOR); + CLOG_DEBUG(LOG, + "preferred_scale (preferred_scale=%.6f)", + double(preferred_scale) / FRACTIONAL_DENOMINATOR); GWL_Window *win = static_cast(data); @@ -1440,7 +1439,7 @@ static void libdecor_frame_handle_configure(libdecor_frame *frame, libdecor_configuration *configuration, void *data) { - CLOG_INFO(LOG, 2, "configure"); + CLOG_DEBUG(LOG, "configure"); # ifdef USE_EVENT_BACKGROUND_THREAD std::lock_guard lock_frame_guard{static_cast(data)->frame_pending_mutex}; @@ -1577,7 +1576,7 @@ static void libdecor_frame_handle_configure(libdecor_frame *frame, static void libdecor_frame_handle_close(libdecor_frame * /*frame*/, void *data) { - CLOG_INFO(LOG, 2, "close"); + CLOG_DEBUG(LOG, "close"); GWL_Window *win = static_cast(data); @@ -1586,7 +1585,7 @@ static void libdecor_frame_handle_close(libdecor_frame * /*frame*/, void *data) static void libdecor_frame_handle_commit(libdecor_frame * /*frame*/, void *data) { - CLOG_INFO(LOG, 2, "commit"); + CLOG_DEBUG(LOG, "commit"); # if 0 GWL_Window *win = static_cast(data); @@ -1619,7 +1618,7 @@ static CLG_LogRef LOG_WL_XDG_TOPLEVEL_DECORATION = {"ghost.wl.handle.xdg_topleve static void xdg_toplevel_decoration_handle_configure( void *data, zxdg_toplevel_decoration_v1 * /*zxdg_toplevel_decoration_v1*/, const uint32_t mode) { - CLOG_INFO(LOG, 2, "configure (mode=%u)", mode); + CLOG_DEBUG(LOG, "configure (mode=%u)", mode); GWL_Window *win = static_cast(data); @@ -1648,10 +1647,10 @@ static void xdg_surface_handle_configure(void *data, GWL_Window *win = static_cast(data); if (win->xdg_decor->surface != xdg_surface) { - CLOG_INFO(LOG, 2, "configure (skipped)"); + CLOG_DEBUG(LOG, "configure (skipped)"); return; } - CLOG_INFO(LOG, 2, "configure"); + CLOG_DEBUG(LOG, "configure"); #ifdef USE_EVENT_BACKGROUND_THREAD std::lock_guard lock_frame_guard{static_cast(data)->frame_pending_mutex}; @@ -1692,10 +1691,10 @@ static CLG_LogRef LOG_WL_SURFACE = {"ghost.wl.handle.surface"}; static void surface_handle_enter(void *data, wl_surface * /*wl_surface*/, wl_output *wl_output) { if (!ghost_wl_output_own(wl_output)) { - CLOG_INFO(LOG, 2, "enter (skipped)"); + CLOG_DEBUG(LOG, "enter (skipped)"); return; } - CLOG_INFO(LOG, 2, "enter"); + CLOG_DEBUG(LOG, "enter"); GWL_Output *reg_output = ghost_wl_output_user_data(wl_output); GHOST_WindowWayland *win = static_cast(data); @@ -1707,10 +1706,10 @@ static void surface_handle_enter(void *data, wl_surface * /*wl_surface*/, wl_out static void surface_handle_leave(void *data, wl_surface * /*wl_surface*/, wl_output *wl_output) { if (!ghost_wl_output_own(wl_output)) { - CLOG_INFO(LOG, 2, "leave (skipped)"); + CLOG_DEBUG(LOG, "leave (skipped)"); return; } - CLOG_INFO(LOG, 2, "leave"); + CLOG_DEBUG(LOG, "leave"); GWL_Output *reg_output = ghost_wl_output_user_data(wl_output); GHOST_WindowWayland *win = static_cast(data); @@ -1726,7 +1725,7 @@ static void surface_handle_preferred_buffer_scale(void * /*data*/, int32_t factor) { /* Only available in interface version 6. */ - CLOG_INFO(LOG, 2, "handle_preferred_buffer_scale (factor=%d)", factor); + CLOG_DEBUG(LOG, "handle_preferred_buffer_scale (factor=%d)", factor); } static void surface_handle_preferred_buffer_transform(void * /*data*/, @@ -1734,7 +1733,7 @@ static void surface_handle_preferred_buffer_transform(void * /*data*/, uint32_t transform) { /* Only available in interface version 6. */ - CLOG_INFO(LOG, 2, "handle_preferred_buffer_transform (transform=%u)", transform); + CLOG_DEBUG(LOG, "handle_preferred_buffer_transform (transform=%u)", transform); } #endif /* WL_SURFACE_PREFERRED_BUFFER_SCALE_SINCE_VERSION && \ * WL_SURFACE_PREFERRED_BUFFER_TRANSFORM_SINCE_VERSION */ diff --git a/source/blender/animrig/intern/evaluation.cc b/source/blender/animrig/intern/evaluation.cc index 389c6c6a648..fc00cfd9e33 100644 --- a/source/blender/animrig/intern/evaluation.cc +++ b/source/blender/animrig/intern/evaluation.cc @@ -164,12 +164,11 @@ static EvaluationResult evaluate_keyframe_data(PointerRNA &animated_id_ptr, { /* Log this at quite a high level, because it can get _very_ noisy when playing back * animation. */ - CLOG_INFO(&LOG, - 4, - "Cannot resolve RNA path %s[%d] on ID %s\n", - fcu->rna_path, - fcu->array_index, - animated_id_ptr.owner_id->name); + CLOG_DEBUG(&LOG, + "Cannot resolve RNA path %s[%d] on ID %s\n", + fcu->rna_path, + fcu->array_index, + animated_id_ptr.owner_id->name); continue; } diff --git a/source/blender/asset_system/intern/asset_catalog.cc b/source/blender/asset_system/intern/asset_catalog.cc index 629ac6918a5..21efd40f20a 100644 --- a/source/blender/asset_system/intern/asset_catalog.cc +++ b/source/blender/asset_system/intern/asset_catalog.cc @@ -345,7 +345,7 @@ void AssetCatalogService::load_directory_recursive(const CatalogFilePath &direct if (!BLI_exists(file_path.data())) { /* No file to be loaded is perfectly fine. */ - CLOG_INFO(&LOG, 2, "path not found: %s", file_path.data()); + CLOG_DEBUG(&LOG, "path not found: %s", file_path.data()); return; } diff --git a/source/blender/asset_system/intern/asset_library_service.cc b/source/blender/asset_system/intern/asset_library_service.cc index bebe7443ee5..aa10e3ba5d9 100644 --- a/source/blender/asset_system/intern/asset_library_service.cc +++ b/source/blender/asset_system/intern/asset_library_service.cc @@ -124,7 +124,7 @@ AssetLibrary *AssetLibraryService::get_asset_library_on_disk( bUserAssetLibrary *preferences_library) { if (OnDiskAssetLibrary *lib = this->lookup_on_disk_library(library_type, root_path)) { - CLOG_INFO(&LOG, 2, "get \"%s\" (cached)", root_path.c_str()); + CLOG_DEBUG(&LOG, "get \"%s\" (cached)", root_path.c_str()); if (load_catalogs) { lib->load_or_reload_catalogs(); } @@ -158,7 +158,7 @@ AssetLibrary *AssetLibraryService::get_asset_library_on_disk( } on_disk_libraries_.add_new({library_type, normalized_root_path}, std::move(lib_uptr)); - CLOG_INFO(&LOG, 2, "get \"%s\" (loaded)", normalized_root_path.c_str()); + CLOG_DEBUG(&LOG, "get \"%s\" (loaded)", normalized_root_path.c_str()); return lib; } @@ -190,11 +190,11 @@ AssetLibrary *AssetLibraryService::get_asset_library_on_disk_builtin(eAssetLibra AssetLibrary *AssetLibraryService::get_asset_library_current_file() { if (current_file_library_) { - CLOG_INFO(&LOG, 2, "get current file lib (cached)"); + CLOG_DEBUG(&LOG, "get current file lib (cached)"); current_file_library_->refresh_catalogs(); } else { - CLOG_INFO(&LOG, 2, "get current file lib (loaded)"); + CLOG_DEBUG(&LOG, "get current file lib (loaded)"); current_file_library_ = std::make_unique(); } @@ -293,11 +293,11 @@ AssetLibrary *AssetLibraryService::get_asset_library_all(const Main *bmain) } if (!all_library_) { - CLOG_INFO(&LOG, 2, "get all lib (loaded)"); + CLOG_DEBUG(&LOG, "get all lib (loaded)"); all_library_ = std::make_unique(); } else { - CLOG_INFO(&LOG, 2, "get all lib (cached)"); + CLOG_DEBUG(&LOG, "get all lib (cached)"); } /* Don't reload catalogs, they've just been loaded above. */ diff --git a/source/blender/asset_system/intern/library_types/all_library.cc b/source/blender/asset_system/intern/library_types/all_library.cc index d078af45cc1..5084bba3be2 100644 --- a/source/blender/asset_system/intern/library_types/all_library.cc +++ b/source/blender/asset_system/intern/library_types/all_library.cc @@ -45,11 +45,10 @@ void AllAssetLibrary::rebuild_catalogs_from_nested(const bool reload_nested_cata /*on_duplicate_items=*/[](const AssetCatalog &existing, const AssetCatalog &to_be_ignored) { if (existing.path == to_be_ignored.path) { - CLOG_INFO(&LOG, - 2, - "multiple definitions of catalog %s (path: %s), ignoring duplicate", - existing.catalog_id.str().c_str(), - existing.path.c_str()); + CLOG_DEBUG(&LOG, + "multiple definitions of catalog %s (path: %s), ignoring duplicate", + existing.catalog_id.str().c_str(), + existing.path.c_str()); } else { CLOG_ERROR(&LOG, diff --git a/source/blender/blenkernel/intern/appdir.cc b/source/blender/blenkernel/intern/appdir.cc index 7f2e17cb33d..8d1079c4f15 100644 --- a/source/blender/blenkernel/intern/appdir.cc +++ b/source/blender/blenkernel/intern/appdir.cc @@ -286,16 +286,16 @@ static bool test_path(char *targetpath, const int path_array_num = (folder_name ? (subfolder_name ? 3 : 2) : 1); BLI_path_join_array(targetpath, targetpath_maxncpy, path_array, path_array_num); if (check_is_dir == false) { - CLOG_INFO(&LOG, 3, "using without test: '%s'", targetpath); + CLOG_DEBUG(&LOG, "Using (without test): '%s'", targetpath); return true; } if (BLI_is_dir(targetpath)) { - CLOG_INFO(&LOG, 3, "found '%s'", targetpath); + CLOG_DEBUG(&LOG, "Found '%s'", targetpath); return true; } - CLOG_INFO(&LOG, 3, "missing '%s'", targetpath); + CLOG_DEBUG(&LOG, "Missing '%s'", targetpath); /* Path not found, don't accidentally use it, * otherwise call this function with `check_is_dir` set to false. */ @@ -323,16 +323,16 @@ static bool test_env_path(char *path, const char *envvar, const bool check_is_di BLI_strncpy(path, env_path, FILE_MAX); if (check_is_dir == false) { - CLOG_INFO(&LOG, 3, "using env '%s' without test: '%s'", envvar, env_path); + CLOG_DEBUG(&LOG, "Using env '%s' (without test): '%s'", envvar, env_path); return true; } if (BLI_is_dir(env_path)) { - CLOG_INFO(&LOG, 3, "env '%s' found: %s", envvar, env_path); + CLOG_DEBUG(&LOG, "Env '%s' found: %s", envvar, env_path); return true; } - CLOG_INFO(&LOG, 3, "env '%s' missing: %s", envvar, env_path); + CLOG_DEBUG(&LOG, "Env '%s' missing: %s", envvar, env_path); /* Path not found, don't accidentally use it, * otherwise call this function with `check_is_dir` set to false. */ @@ -361,11 +361,10 @@ static bool get_path_local_ex(char *targetpath, { char relfolder[FILE_MAX]; - CLOG_INFO(&LOG, - 3, - "folder='%s', subfolder='%s'", - STR_OR_FALLBACK(folder_name), - STR_OR_FALLBACK(subfolder_name)); + CLOG_DEBUG(&LOG, + "Get path local: folder='%s', subfolder='%s'", + STR_OR_FALLBACK(folder_name), + STR_OR_FALLBACK(subfolder_name)); if (folder_name) { /* `subfolder_name` may be nullptr. */ const char *path_array[] = {folder_name, subfolder_name}; @@ -518,12 +517,11 @@ static bool get_path_user_ex(char *targetpath, return false; } - CLOG_INFO(&LOG, - 3, - "'%s', folder='%s', subfolder='%s'", - user_path, - STR_OR_FALLBACK(folder_name), - STR_OR_FALLBACK(subfolder_name)); + CLOG_DEBUG(&LOG, + "Get path user: '%s', folder='%s', subfolder='%s'", + user_path, + STR_OR_FALLBACK(folder_name), + STR_OR_FALLBACK(subfolder_name)); /* `subfolder_name` may be nullptr. */ return test_path( @@ -574,12 +572,11 @@ static bool get_path_system_ex(char *targetpath, return false; } - CLOG_INFO(&LOG, - 3, - "'%s', folder='%s', subfolder='%s'", - system_path, - STR_OR_FALLBACK(folder_name), - STR_OR_FALLBACK(subfolder_name)); + CLOG_DEBUG(&LOG, + "Get path system: '%s', folder='%s', subfolder='%s'", + system_path, + STR_OR_FALLBACK(folder_name), + STR_OR_FALLBACK(subfolder_name)); /* Try `$BLENDERPATH/folder_name/subfolder_name`, `subfolder_name` may be nullptr. */ return test_path( @@ -880,7 +877,7 @@ static void where_am_i(char *program_filepath, conv_utf_16_to_8(fullname_16, program_filepath, program_filepath_maxncpy); if (!BLI_exists(program_filepath)) { CLOG_ERROR(&LOG, - "path can't be found: \"%.*s\"", + "Program path can't be found: \"%.*s\"", int(program_filepath_maxncpy), program_filepath); MessageBox(nullptr, @@ -921,7 +918,7 @@ static void where_am_i(char *program_filepath, # ifndef NDEBUG if (!STREQ(program_name, program_filepath)) { - CLOG_INFO(&LOG, 2, "guessing '%s' == '%s'", program_name, program_filepath); + CLOG_DEBUG(&LOG, "Program path guessing '%s' == '%s'", program_name, program_filepath); } # endif } diff --git a/source/blender/blenkernel/intern/blender.cc b/source/blender/blenkernel/intern/blender.cc index 5808f21fa58..1f5edba838b 100644 --- a/source/blender/blenkernel/intern/blender.cc +++ b/source/blender/blenkernel/intern/blender.cc @@ -50,6 +50,8 @@ #include "SEQ_utils.hh" +#include "CLG_log.h" + Global G; UserDef U; @@ -206,7 +208,7 @@ void BKE_blender_globals_init() G.f &= ~G_FLAG_SCRIPT_AUTOEXEC; #endif - G.log.level = 1; + G.log.level = CLG_LEVEL_WARN; G.profile_gpu = false; } diff --git a/source/blender/blenkernel/intern/blendfile.cc b/source/blender/blenkernel/intern/blendfile.cc index ff018906a4e..dff992d0598 100644 --- a/source/blender/blenkernel/intern/blendfile.cc +++ b/source/blender/blenkernel/intern/blendfile.cc @@ -1794,9 +1794,8 @@ void PartialWriteContext::preempt_session_uid(ID *ctx_id, uint session_uid) matching_ctx_id = BKE_main_idmap_lookup_uid(this->bmain.id_map, session_uid); BLI_assert(matching_ctx_id != ctx_id); if (matching_ctx_id) { - CLOG_INFO(&LOG_PARTIALWRITE, - 3, - "Non-matching IDs sharing the same session UID in the partial write context."); + CLOG_DEBUG(&LOG_PARTIALWRITE, + "Non-matching IDs sharing the same session UID in the partial write context."); BKE_main_idmap_remove_id(this->bmain.id_map, matching_ctx_id); /* FIXME: Allow #BKE_lib_libblock_session_uid_renew to work with temp IDs? */ matching_ctx_id->tag &= ~ID_TAG_TEMP_MAIN; @@ -2112,10 +2111,9 @@ void PartialWriteContext::remove_unused(const bool clear_extra_user) } BKE_lib_query_unused_ids_tag(&this->bmain, ID_TAG_DOIT, parameters); - CLOG_INFO(&LOG_PARTIALWRITE, - 3, - "Removing %d unused IDs from current partial write context", - parameters.num_total[INDEX_ID_NULL]); + CLOG_DEBUG(&LOG_PARTIALWRITE, + "Removing %d unused IDs from current partial write context", + parameters.num_total[INDEX_ID_NULL]); ID *id_iter; FOREACH_MAIN_ID_BEGIN (&this->bmain, id_iter) { if ((id_iter->tag & ID_TAG_DOIT) != 0) { diff --git a/source/blender/blenkernel/intern/blendfile_link_append.cc b/source/blender/blenkernel/intern/blendfile_link_append.cc index 4c5b9cc9833..55f7e249bd7 100644 --- a/source/blender/blenkernel/intern/blendfile_link_append.cc +++ b/source/blender/blenkernel/intern/blendfile_link_append.cc @@ -1055,11 +1055,10 @@ static int foreach_libblock_append_finalize_action_callback(LibraryIDLinkCallbac BLI_assert(data->item->action == LINK_APPEND_ACT_KEEP_LINKED); if (item->action == LINK_APPEND_ACT_MAKE_LOCAL) { - CLOG_INFO(&LOG, - 3, - "Appended ID '%s' was to be made directly local, but is also used by data that is " - "kept linked, so duplicating it instead.", - id->name); + CLOG_DEBUG(&LOG, + "Appended ID '%s' was to be made directly local, but is also used by data that is " + "kept linked, so duplicating it instead.", + id->name); item->action = LINK_APPEND_ACT_COPY_LOCAL; } return IDWALK_RET_NOP; @@ -1140,9 +1139,8 @@ static void blendfile_append_define_actions(BlendfileLinkAppendContext &lapp_con } /* IDs exclusively used as liboverride reference should not be made local at all. */ if ((item.tag & LINK_APPEND_TAG_LIBOVERRIDE_DEPENDENCY_ONLY) != 0) { - CLOG_INFO( + CLOG_DEBUG( &LOG, - 3, "Appended ID '%s' is only used as a liboverride linked dependency, keeping it linked.", id->name); item.action = LINK_APPEND_ACT_KEEP_LINKED; @@ -1151,11 +1149,10 @@ static void blendfile_append_define_actions(BlendfileLinkAppendContext &lapp_con /* In non-recursive append case, only IDs from the same libraries as the directly appended * ones are made local. All dependencies from other libraries are kept linked. */ if (!do_recursive && !direct_libraries.contains(id->lib)) { - CLOG_INFO(&LOG, - 3, - "Appended ID '%s' belongs to another library and recursive append is disabled, " - "keeping it linked.", - id->name); + CLOG_DEBUG(&LOG, + "Appended ID '%s' belongs to another library and recursive append is disabled, " + "keeping it linked.", + id->name); item.action = LINK_APPEND_ACT_KEEP_LINKED; item.reusable_local_id = nullptr; } @@ -1215,17 +1212,16 @@ static void blendfile_append_define_actions(BlendfileLinkAppendContext &lapp_con BLI_assert((item.tag & LINK_APPEND_TAG_LIBOVERRIDE_DEPENDENCY_ONLY) == 0); if (do_reuse_local_id && item.reusable_local_id != nullptr) { - CLOG_INFO(&LOG, 3, "Appended ID '%s' as a matching local one, re-using it.", id->name); + CLOG_DEBUG(&LOG, "Appended ID '%s' as a matching local one, re-using it.", id->name); item.action = LINK_APPEND_ACT_REUSE_LOCAL; } else if (id->tag & ID_TAG_PRE_EXISTING) { - CLOG_INFO(&LOG, 3, "Appended ID '%s' was already linked, duplicating it.", id->name); + CLOG_DEBUG(&LOG, "Appended ID '%s' was already linked, duplicating it.", id->name); item.action = LINK_APPEND_ACT_COPY_LOCAL; } else if (item.tag & LINK_APPEND_TAG_LIBOVERRIDE_DEPENDENCY) { - CLOG_INFO( + CLOG_DEBUG( &LOG, - 3, "Appended ID '%s' is also used as a liboverride linked dependency, duplicating it.", id->name); item.action = LINK_APPEND_ACT_COPY_LOCAL; @@ -1236,7 +1232,7 @@ static void blendfile_append_define_actions(BlendfileLinkAppendContext &lapp_con * made local, etc. * * So for now, simpler to always duplicate linked liboverrides. */ - CLOG_INFO(&LOG, 3, "Appended ID '%s' is a liboverride, duplicating it.", id->name); + CLOG_DEBUG(&LOG, "Appended ID '%s' is a liboverride, duplicating it.", id->name); item.action = LINK_APPEND_ACT_COPY_LOCAL; } else { @@ -1244,7 +1240,7 @@ static void blendfile_append_define_actions(BlendfileLinkAppendContext &lapp_con * #LINK_APPEND_ACT_COPY_LOCAL in the last checks below. This can happen in rare cases with * complex relationships involving IDs that are kept linked and IDs that are made local, * both using some same dependencies. */ - CLOG_INFO(&LOG, 3, "Appended ID '%s' will be made local.", id->name); + CLOG_DEBUG(&LOG, "Appended ID '%s' will be made local.", id->name); item.action = LINK_APPEND_ACT_MAKE_LOCAL; } } @@ -1712,12 +1708,11 @@ static void blendfile_library_relocate_id_remap_do(Main *bmain, BLI_assert(new_id); } if (new_id) { - CLOG_INFO(&LOG, - 4, - "Before remap of %s, old_id users: %d, new_id users: %d", - old_id->name, - old_id->us, - new_id->us); + CLOG_DEBUG(&LOG, + "Before remap of %s, old_id users: %d, new_id users: %d", + old_id->name, + old_id->us, + new_id->us); BKE_libblock_remap_locked(bmain, old_id, new_id, remap_flags); if (old_id->flag & ID_FLAG_FAKEUSER) { @@ -1725,12 +1720,11 @@ static void blendfile_library_relocate_id_remap_do(Main *bmain, id_fake_user_set(new_id); } - CLOG_INFO(&LOG, - 4, - "After remap of %s, old_id users: %d, new_id users: %d", - old_id->name, - old_id->us, - new_id->us); + CLOG_DEBUG(&LOG, + "After remap of %s, old_id users: %d, new_id users: %d", + old_id->name, + old_id->us, + new_id->us); /* In some cases, new_id might become direct link, remove parent of library in this case. */ if (new_id->lib->runtime->parent && (new_id->tag & ID_TAG_INDIRECT) == 0) { @@ -1986,7 +1980,7 @@ void BKE_blendfile_library_relocate(BlendfileLinkAppendContext *lapp_context, lapp_context, BKE_id_name(*id), idcode, id); item->libraries.fill(true); - CLOG_INFO(&LOG, 4, "Datablock to seek for: %s", id->name); + CLOG_DEBUG(&LOG, "Datablock to seek for: %s", id->name); } } } diff --git a/source/blender/blenkernel/intern/context.cc b/source/blender/blenkernel/intern/context.cc index fcb3e00ec47..52b6133c60b 100644 --- a/source/blender/blenkernel/intern/context.cc +++ b/source/blender/blenkernel/intern/context.cc @@ -51,7 +51,7 @@ using blender::Vector; -static CLG_LogRef LOG = {"core.context"}; +static CLG_LogRef LOG = {"context"}; /* struct */ diff --git a/source/blender/blenkernel/intern/dynamicpaint.cc b/source/blender/blenkernel/intern/dynamicpaint.cc index b040b61304c..63b0653fd47 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.cc +++ b/source/blender/blenkernel/intern/dynamicpaint.cc @@ -2866,8 +2866,8 @@ int dynamicPaint_createUVSurface(Scene *scene, /* * Start generating the surface */ - CLOG_INFO( - &LOG, 1, "Preparing UV surface of %ix%i pixels and %i tris.", w, h, int(corner_tris.size())); + CLOG_DEBUG( + &LOG, "Preparing UV surface of %ix%i pixels and %i tris.", w, h, int(corner_tris.size())); /* Init data struct */ if (surface->data) { diff --git a/source/blender/blenkernel/intern/image.cc b/source/blender/blenkernel/intern/image.cc index 6d94ad1b62e..188ac2847c1 100644 --- a/source/blender/blenkernel/intern/image.cc +++ b/source/blender/blenkernel/intern/image.cc @@ -2709,7 +2709,7 @@ MovieReader *openanim(const char *filepath, else { reason = "not an anim"; } - CLOG_INFO(&LOG, 1, "unable to load anim, %s: %s", reason, filepath); + CLOG_INFO(&LOG, "unable to load anim, %s: %s", reason, filepath); MOV_close(anim); return nullptr; diff --git a/source/blender/blenkernel/intern/image_save.cc b/source/blender/blenkernel/intern/image_save.cc index e97f80e932d..5413962ed6a 100644 --- a/source/blender/blenkernel/intern/image_save.cc +++ b/source/blender/blenkernel/intern/image_save.cc @@ -1043,7 +1043,7 @@ static void image_render_print_save_message(ReportList *reports, if (ok) { /* no need to report, just some helpful console info */ if (!G.quiet) { - CLOG_INFO(&LOG_RENDER, 0, "Saved: '%s'", filepath); + CLOG_INFO(&LOG_RENDER, "Saved: '%s'", filepath); } } else { diff --git a/source/blender/blenkernel/intern/layer.cc b/source/blender/blenkernel/intern/layer.cc index 29f0233f1d3..ba7f4dedacb 100644 --- a/source/blender/blenkernel/intern/layer.cc +++ b/source/blender/blenkernel/intern/layer.cc @@ -864,15 +864,14 @@ static LayerCollectionResync *layer_collection_resync_create_recurse( } } - CLOG_INFO(&LOG, - 4, - "Old LayerCollection for %s is...\n\tusable: %d\n\tvalid parent: %d\n\tvalid child: " - "%d\n\tused: %d\n", - layer_resync->collection ? layer_resync->collection->id.name : "", - layer_resync->is_usable, - layer_resync->is_valid_as_parent, - layer_resync->is_valid_as_child, - layer_resync->is_used); + CLOG_DEBUG(&LOG, + "Old LayerCollection for %s is...\n\tusable: %d\n\tvalid parent: %d\n\tvalid child: " + "%d\n\tused: %d\n", + layer_resync->collection ? layer_resync->collection->id.name : "", + layer_resync->is_usable, + layer_resync->is_valid_as_parent, + layer_resync->is_valid_as_child, + layer_resync->is_used); return layer_resync; } @@ -966,11 +965,10 @@ static void layer_collection_resync_unused_layers_free(ViewLayer *view_layer, } if (!layer_resync->is_used) { - CLOG_INFO(&LOG, - 4, - "Freeing unused LayerCollection for %s", - layer_resync->collection != nullptr ? layer_resync->collection->id.name : - ""); + CLOG_DEBUG(&LOG, + "Freeing unused LayerCollection for %s", + layer_resync->collection != nullptr ? layer_resync->collection->id.name : + ""); if (layer_resync->layer == view_layer->active_collection) { view_layer->active_collection = nullptr; @@ -1130,18 +1128,16 @@ static void layer_collection_sync(ViewLayer *view_layer, BLI_assert(child_layer_resync->is_usable); if (child_layer_resync->is_used) { - CLOG_INFO(&LOG, - 4, - "Found same existing LayerCollection for %s as child of %s", - child_collection->id.name, - layer_resync->collection->id.name); + CLOG_DEBUG(&LOG, + "Found same existing LayerCollection for %s as child of %s", + child_collection->id.name, + layer_resync->collection->id.name); } else { - CLOG_INFO(&LOG, - 4, - "Found a valid unused LayerCollection for %s as child of %s, re-using it", - child_collection->id.name, - layer_resync->collection->id.name); + CLOG_DEBUG(&LOG, + "Found a valid unused LayerCollection for %s as child of %s, re-using it", + child_collection->id.name, + layer_resync->collection->id.name); } child_layer_resync->is_used = true; @@ -1156,11 +1152,10 @@ static void layer_collection_sync(ViewLayer *view_layer, BLI_addtail(&new_lb_layer, child_layer_resync->layer); } else { - CLOG_INFO(&LOG, - 4, - "No available LayerCollection for %s as child of %s, creating a new one", - child_collection->id.name, - layer_resync->collection->id.name); + CLOG_DEBUG(&LOG, + "No available LayerCollection for %s as child of %s, creating a new one", + child_collection->id.name, + layer_resync->collection->id.name); LayerCollection *child_layer = layer_collection_add(&new_lb_layer, child_collection); child_layer->flag = parent_layer_flag; diff --git a/source/blender/blenkernel/intern/lib_override.cc b/source/blender/blenkernel/intern/lib_override.cc index 21268b9ee89..943e3a4f931 100644 --- a/source/blender/blenkernel/intern/lib_override.cc +++ b/source/blender/blenkernel/intern/lib_override.cc @@ -1933,14 +1933,13 @@ static void lib_override_root_hierarchy_set( } } - CLOG_INFO(&LOG, - 3, - "Modifying library override hierarchy of ID '%s'.\n" - "\tFrom old root '%s' to new root '%s'.", - id->name, - id->override_library->hierarchy_root ? id->override_library->hierarchy_root->name : - "", - id_root->name); + CLOG_DEBUG(&LOG, + "Modifying library override hierarchy of ID '%s'.\n" + "\tFrom old root '%s' to new root '%s'.", + id->name, + id->override_library->hierarchy_root ? id->override_library->hierarchy_root->name : + "", + id_root->name); id->override_library->hierarchy_root = id_root; } @@ -1996,9 +1995,8 @@ void BKE_lib_override_library_main_hierarchy_root_ensure(Main *bmain) * been caught by the first check above. Invalid hierarchy roots detected here can happen * in normal situations, e.g. when breaking a hierarchy by making one of its components * local. See also #137412. */ - CLOG_INFO( + CLOG_DEBUG( &LOG, - 2, "Existing override hierarchy root ('%s') for ID '%s' is invalid, will try to find a " "new valid one", id->override_library->hierarchy_root != nullptr ? @@ -2488,11 +2486,10 @@ static bool lib_override_library_resync( linkedref_to_old_override, &key_reference_iter->id, &key_override_old->id); } - CLOG_INFO(&LOG_RESYNC, - 2, - "Found missing linked old override best-match %s for new linked override %s", - id_override_old->name, - id_override_new->name); + CLOG_DEBUG(&LOG_RESYNC, + "Found missing linked old override best-match %s for new linked override %s", + id_override_old->name, + id_override_new->name); } } @@ -2657,12 +2654,11 @@ static bool lib_override_library_resync( strstr(op->rna_path, "parent_type") || strstr(op->rna_path, "parent_bone") || strstr(op->rna_path, "parent_vertices")) { - CLOG_INFO(&LOG_RESYNC, - 2, - "Deleting liboverride property '%s' from object %s, as its parent pointer " - "matches the reference data hierarchy wise", - id_override_new->name + 2, - op->rna_path); + CLOG_DEBUG(&LOG_RESYNC, + "Deleting liboverride property '%s' from object %s, as its parent pointer " + "matches the reference data hierarchy wise", + id_override_new->name + 2, + op->rna_path); BKE_lib_override_library_property_delete(id_override_new->override_library, op); } } @@ -2750,7 +2746,7 @@ static bool lib_override_library_resync( else if (!BKE_lib_override_library_is_user_edited(id)) { /* If user never edited them, we can delete them. */ do_delete = true; - CLOG_INFO(&LOG_RESYNC, 2, "Old override %s is being deleted", id->name); + CLOG_DEBUG(&LOG_RESYNC, "Old override %s is being deleted", id->name); } #if 0 else { @@ -2759,8 +2755,7 @@ static bool lib_override_library_resync( do_delete = false; id_fake_user_set(id); id->flag |= ID_FLAG_LIB_OVERRIDE_RESYNC_LEFTOVER; - CLOG_INFO(&LOG_RESYNC, - 2, + CLOG_DEBUG(&LOG_RESYNC, "Old override %s is being kept around as it was user-edited", id->name); } @@ -2882,12 +2877,13 @@ static void lib_override_cleanup_after_resync(Main *bmain) return false; }; BKE_lib_query_unused_ids_tag(bmain, ID_TAG_DOIT, parameters); - CLOG_INFO(&LOG_RESYNC, - 2, - "Deleting %d unused linked missing IDs and their unused liboverrides (including %d " - "local ones)\n", - parameters.num_total[INDEX_ID_NULL], - parameters.num_local[INDEX_ID_NULL]); + if (parameters.num_total[INDEX_ID_NULL]) { + CLOG_DEBUG(&LOG_RESYNC, + "Deleting %d unused linked missing IDs and their unused liboverrides (including %d " + "local ones)\n", + parameters.num_total[INDEX_ID_NULL], + parameters.num_local[INDEX_ID_NULL]); + } BKE_id_multi_tagged_delete(bmain); } @@ -2997,12 +2993,12 @@ static void lib_override_resync_tagging_finalize_recurse(Main *bmain, * tagged for resync then. */ is_reprocessing_current_entry = true; - CLOG_INFO(&LOG, - 4, - "ID %s (%p) is detected as part of a hierarchy dependency loop requiring resync, it " - "is now being re-processed to ensure proper tagging of the whole loop", - id_root->name, - id_root->lib); + CLOG_DEBUG( + &LOG, + "ID %s (%p) is detected as part of a hierarchy dependency loop requiring resync, it " + "is now being re-processed to ensure proper tagging of the whole loop", + id_root->name, + id_root->lib); } else if (entry->tags & MAINIDRELATIONS_ENTRY_TAGS_PROCESSED) { /* This ID has already been processed. */ @@ -3013,9 +3009,8 @@ static void lib_override_resync_tagging_finalize_recurse(Main *bmain, * anymore, if now processed as part of another partial resync hierarchy. */ if (id_root->tag & ID_TAG_LIBOVERRIDE_NEED_RESYNC) { if (entry->tags & MAINIDRELATIONS_ENTRY_TAGS_DOIT && is_in_partial_resync_hierarchy) { - CLOG_INFO( + CLOG_DEBUG( &LOG, - 4, "ID %s (%p) was marked as a potential root for partial resync, but it is used by " "%s (%p), which is also tagged for resync, so it is not a root after all", id_root->name, @@ -3043,14 +3038,13 @@ static void lib_override_resync_tagging_finalize_recurse(Main *bmain, BLI_assert(id_from != nullptr); if ((id_root->tag & ID_TAG_LIBOVERRIDE_NEED_RESYNC) == 0) { - CLOG_INFO(&LOG, - 4, - "ID %s (%p) now tagged as needing resync because they are used by %s (%p) " - "that needs to be resynced", - id_root->name, - id_root->lib, - id_from->name, - id_from->lib); + CLOG_DEBUG(&LOG, + "ID %s (%p) now tagged as needing resync because they are used by %s (%p) " + "that needs to be resynced", + id_root->name, + id_root->lib, + id_from->name, + id_from->lib); id_root->tag |= ID_TAG_LIBOVERRIDE_NEED_RESYNC; } } @@ -3118,11 +3112,8 @@ static void lib_override_resync_tagging_finalize_recurse(Main *bmain, /* This ID (and its whole sub-tree of dependencies) is now considered as processed. If it is * tagged for resync, but its 'calling parent' is not, it is a potential partial resync root. */ - CLOG_INFO(&LOG_RESYNC, - 4, - "Potential root for partial resync: %s (%p)", - id_root->name, - id_root->lib); + CLOG_DEBUG( + &LOG_RESYNC, "Potential root for partial resync: %s (%p)", id_root->name, id_root->lib); entry->tags |= MAINIDRELATIONS_ENTRY_TAGS_DOIT; } } @@ -3315,18 +3306,16 @@ static void lib_override_resync_tagging_finalize(Main *bmain, { BLI_assert((id_iter->override_library->runtime->tag & LIBOVERRIDE_TAG_RESYNC_ISOLATED_FROM_ROOT) == 0); - CLOG_INFO(&LOG_RESYNC, - 4, - "ID %s (%p) detected as only related to its hierarchy root by 'reversed' " - "relationship(s) (e.g. object parenting), tagging it as needing " - "resync", - id_iter->name, - id_iter->lib); + CLOG_DEBUG(&LOG_RESYNC, + "ID %s (%p) detected as only related to its hierarchy root by 'reversed' " + "relationship(s) (e.g. object parenting), tagging it as needing " + "resync", + id_iter->name, + id_iter->lib); } else { - CLOG_INFO( + CLOG_DEBUG( &LOG_RESYNC, - 4, "ID %s (%p) detected as 'isolated' from its hierarchy root, tagging it as needing " "resync", id_iter->name, @@ -3362,11 +3351,10 @@ static void lib_override_resync_tagging_finalize(Main *bmain, BLI_assert(hierarchy_root->lib == id_iter->lib); if (id_iter != hierarchy_root) { - CLOG_INFO(&LOG_RESYNC, - 4, - "Found root ID '%s' for partial resync root ID '%s'", - hierarchy_root->name, - id_iter->name); + CLOG_DEBUG(&LOG_RESYNC, + "Found root ID '%s' for partial resync root ID '%s'", + hierarchy_root->name, + id_iter->name); BLI_assert(hierarchy_root->override_library != nullptr); @@ -3456,8 +3444,8 @@ static bool lib_override_library_main_resync_on_library_indirect_level( } if (id->tag & ID_TAG_LIBOVERRIDE_NEED_RESYNC) { - CLOG_INFO( - &LOG_RESYNC, 4, "ID %s (%p) was already tagged as needing resync", id->name, id->lib); + CLOG_DEBUG( + &LOG_RESYNC, "ID %s (%p) was already tagged as needing resync", id->name, id->lib); if (ID_IS_OVERRIDE_LIBRARY_REAL(id)) { override_library_runtime_ensure(id->override_library)->tag |= LIBOVERRIDE_TAG_NEED_RESYNC_ORIGINAL; @@ -3479,14 +3467,13 @@ static bool lib_override_library_main_resync_on_library_indirect_level( /* Case where this ID pointer was to a linked ID, that now needs to be overridden. */ if (ID_IS_LINKED(id_to) && (id_to->lib != id->lib) && (id_to->tag & ID_TAG_DOIT) != 0) { - CLOG_INFO(&LOG_RESYNC, - 3, - "ID %s (%p) now tagged as needing resync because they use linked %s (%p) that " - "now needs to be overridden", - id->name, - id->lib, - id_to->name, - id_to->lib); + CLOG_DEBUG(&LOG_RESYNC, + "ID %s (%p) now tagged as needing resync because they use linked %s (%p) that " + "now needs to be overridden", + id->name, + id->lib, + id_to->name, + id_to->lib); id->tag |= ID_TAG_LIBOVERRIDE_NEED_RESYNC; break; } @@ -3509,10 +3496,9 @@ static bool lib_override_library_main_resync_on_library_indirect_level( ID *id_root = static_cast(BLI_ghashIterator_getKey(id_roots_iter)); LinkNodePair *id_resync_roots = static_cast( BLI_ghashIterator_getValue(id_roots_iter)); - CLOG_INFO(&LOG_RESYNC, - 2, - "Checking validity of computed TODO data for root '%s'... \n", - id_root->name); + CLOG_DEBUG(&LOG_RESYNC, + "Checking validity of computed TODO data for root '%s'... \n", + id_root->name); if (id_root->tag & ID_TAG_LIBOVERRIDE_NEED_RESYNC) { LinkNode *id_resync_root_iter = id_resync_roots->list; @@ -3573,12 +3559,11 @@ static bool lib_override_library_main_resync_on_library_indirect_level( id_root->lib->runtime->tag |= LIBRARY_TAG_RESYNC_REQUIRED; } - CLOG_INFO(&LOG_RESYNC, - 2, - "Resyncing all dependencies under root %s (%p), first one being '%s'...", - id_root->name, - reinterpret_cast(library), - reinterpret_cast(id_resync_roots->list->link)->name); + CLOG_DEBUG(&LOG_RESYNC, + "Resyncing all dependencies under root %s (%p), first one being '%s'...", + id_root->name, + reinterpret_cast(library), + reinterpret_cast(id_resync_roots->list->link)->name); const bool success = lib_override_library_resync(bmain, new_to_old_libraries_map, scene, @@ -3590,7 +3575,7 @@ static bool lib_override_library_main_resync_on_library_indirect_level( false, false, reports); - CLOG_INFO(&LOG_RESYNC, 2, "\tSuccess: %d", success); + CLOG_DEBUG(&LOG_RESYNC, "\tSuccess: %d", success); if (success) { reports->count.resynced_lib_overrides++; if (library_indirect_level > 0 && reports->do_resynced_lib_overrides_libraries_list && @@ -3659,15 +3644,14 @@ static bool lib_override_library_main_resync_on_library_indirect_level( } else if (need_resync) { if (need_reseync_original) { - CLOG_INFO(&LOG_RESYNC, - 2, - "ID override %s from library level %d still found as needing resync after " - "tackling library level %d. Since it was originally tagged as such by " - "RNA/liboverride apply code, this whole level of library needs to be processed " - "another time.", - id->name, - ID_IS_LINKED(id) ? id->lib->runtime->temp_index : 0, - library_indirect_level); + CLOG_DEBUG(&LOG_RESYNC, + "ID override %s from library level %d still found as needing resync after " + "tackling library level %d. Since it was originally tagged as such by " + "RNA/liboverride apply code, this whole level of library needs to be processed " + "another time.", + id->name, + ID_IS_LINKED(id) ? id->lib->runtime->temp_index : 0, + library_indirect_level); process_lib_level_again = true; /* Cleanup tag for now, will be re-set by next iteration of this function. */ id->override_library->runtime->tag &= ~LIBOVERRIDE_TAG_NEED_RESYNC_ORIGINAL; @@ -3676,14 +3660,13 @@ static bool lib_override_library_main_resync_on_library_indirect_level( /* If it was only tagged for resync as part of resync process itself, it means it was * originally inside of a resync hierarchy, but not in the matching reference hierarchy * anymore. So it did not actually need to be resynced, simply clear the tag. */ - CLOG_INFO(&LOG_RESYNC, - 4, - "ID override %s from library level %d still found as needing resync after " - "tackling library level %d. However, it was not tagged as such by " - "RNA/liboverride apply code, so ignoring it", - id->name, - ID_IS_LINKED(id) ? id->lib->runtime->temp_index : 0, - library_indirect_level); + CLOG_DEBUG(&LOG_RESYNC, + "ID override %s from library level %d still found as needing resync after " + "tackling library level %d. However, it was not tagged as such by " + "RNA/liboverride apply code, so ignoring it", + id->name, + ID_IS_LINKED(id) ? id->lib->runtime->temp_index : 0, + library_indirect_level); id->tag &= ~ID_TAG_LIBOVERRIDE_NEED_RESYNC; } } @@ -3860,11 +3843,10 @@ void BKE_lib_override_library_main_resync( level_reprocess_count); break; } - CLOG_INFO(&LOG_RESYNC, - 4, - "Applying reprocess %d for resyncing at library level %d", - level_reprocess_count, - library_indirect_level); + CLOG_DEBUG(&LOG_RESYNC, + "Applying reprocess %d for resyncing at library level %d", + level_reprocess_count, + library_indirect_level); } library_indirect_level--; } @@ -3888,11 +3870,10 @@ void BKE_lib_override_library_main_resync( LISTBASE_FOREACH (Library *, library, &bmain->libraries) { if (library->runtime->tag & LIBRARY_TAG_RESYNC_REQUIRED) { - CLOG_INFO(&LOG_RESYNC, - 2, - "library '%s' contains some linked overrides that required recursive resync, " - "consider updating it", - library->filepath); + CLOG_DEBUG(&LOG_RESYNC, + "library '%s' contains some linked overrides that required recursive resync, " + "consider updating it", + library->filepath); } } @@ -4652,19 +4633,17 @@ static void lib_override_library_operations_create(Main *bmain, &local_report_flags); if (local_report_flags & RNA_OVERRIDE_MATCH_RESULT_RESTORED) { - CLOG_INFO(&LOG, 2, "We did restore some properties of %s from its reference", local->name); + CLOG_DEBUG(&LOG, "We did restore some properties of %s from its reference", local->name); } if (local_report_flags & RNA_OVERRIDE_MATCH_RESULT_RESTORE_TAGGED) { - CLOG_INFO(&LOG, - 2, - "We did tag some properties of %s for restoration from its reference", - local->name); + CLOG_DEBUG( + &LOG, "We did tag some properties of %s for restoration from its reference", local->name); } if (local_report_flags & RNA_OVERRIDE_MATCH_RESULT_CREATED) { - CLOG_INFO(&LOG, 2, "We did generate library override rules for %s", local->name); + CLOG_DEBUG(&LOG, "We did generate library override rules for %s", local->name); } else { - CLOG_INFO(&LOG, 2, "No new library override rules for %s", local->name); + CLOG_DEBUG(&LOG, "No new library override rules for %s", local->name); } if (r_report_flags != nullptr) { diff --git a/source/blender/blenkernel/intern/lib_override_proxy_conversion.cc b/source/blender/blenkernel/intern/lib_override_proxy_conversion.cc index 276ff9c0eda..6f5887c3d2a 100644 --- a/source/blender/blenkernel/intern/lib_override_proxy_conversion.cc +++ b/source/blender/blenkernel/intern/lib_override_proxy_conversion.cc @@ -104,10 +104,8 @@ static void lib_override_library_proxy_convert_do(Main *bmain, const bool success = BKE_lib_override_library_proxy_convert(bmain, scene, nullptr, ob_proxy); if (success) { - CLOG_INFO(&LOG, - 4, - "Proxy object '%s' successfully converted to library overrides", - ob_proxy->id.name); + CLOG_INFO( + &LOG, "Proxy object '%s' successfully converted to library overrides", ob_proxy->id.name); /* Remove the instance empty from this scene, the items now have an overridden collection * instead. */ if (is_override_instancing_object) { diff --git a/source/blender/blenkernel/intern/library.cc b/source/blender/blenkernel/intern/library.cc index d8ba57b5af8..908fdf9eaf6 100644 --- a/source/blender/blenkernel/intern/library.cc +++ b/source/blender/blenkernel/intern/library.cc @@ -127,7 +127,7 @@ static void library_blend_write_data(BlendWriter *writer, ID *id, const void *id if (library->packedfile) { BKE_packedfile_blend_write(writer, library->packedfile); if (!is_undo) { - CLOG_INFO(&LOG, 2, "Write packed .blend: %s", library->filepath); + CLOG_DEBUG(&LOG, "Write packed .blend: %s", library->filepath); } } } diff --git a/source/blender/blenkernel/intern/mesh_validate.cc b/source/blender/blenkernel/intern/mesh_validate.cc index 05a4fea3b86..9b2cce54def 100644 --- a/source/blender/blenkernel/intern/mesh_validate.cc +++ b/source/blender/blenkernel/intern/mesh_validate.cc @@ -147,7 +147,7 @@ static bool search_face_corner_cmp(const SortFace &sp1, const SortFace &sp2) #define PRINT_MSG(...) \ if (do_verbose) { \ - CLOG_INFO(&LOG, 1, __VA_ARGS__); \ + CLOG_INFO(&LOG, __VA_ARGS__); \ } \ ((void)0) @@ -1025,7 +1025,7 @@ bool BKE_mesh_validate(Mesh *mesh, const bool do_verbose, const bool cddata_chec bool changed; if (do_verbose) { - CLOG_INFO(&LOG, 0, "MESH: %s", mesh->id.name + 2); + CLOG_INFO(&LOG, "Validating Mesh: %s", mesh->id.name + 2); } BKE_mesh_validate_all_customdata(&mesh->vert_data, diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.cc b/source/blender/blenkernel/intern/pbvh_bmesh.cc index 8a1dcfe4c16..b733371a111 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.cc +++ b/source/blender/blenkernel/intern/pbvh_bmesh.cc @@ -1278,8 +1278,7 @@ static bool pbvh_bmesh_subdivide_long_edges(const EdgeQueueContext *eq_ctx, pbvh_bmesh_edge_tag_verify(pbvh); #endif - CLOG_INFO( - &LOG, 2, "Long edge subdivision took %f seconds.", BLI_time_now_seconds() - start_time); + CLOG_DEBUG(&LOG, "Long edge subdivision took %f seconds.", BLI_time_now_seconds() - start_time); return any_subdivided; } @@ -1787,7 +1786,7 @@ static bool pbvh_bmesh_collapse_short_edges(const EdgeQueueContext *eq_ctx, eq_ctx); } - CLOG_INFO(&LOG, 2, "Short edge collapse took %f seconds.", BLI_time_now_seconds() - start_time); + CLOG_DEBUG(&LOG, "Short edge collapse took %f seconds.", BLI_time_now_seconds() - start_time); return any_collapsed; } diff --git a/source/blender/blenkernel/intern/report.cc b/source/blender/blenkernel/intern/report.cc index 3da9c10d52c..8144a3b6817 100644 --- a/source/blender/blenkernel/intern/report.cc +++ b/source/blender/blenkernel/intern/report.cc @@ -34,8 +34,7 @@ void BKE_report_log(eReportType type, const char *message, CLG_LogRef *log) { switch (type) { case RPT_DEBUG: - /* TODO: revisit */ - CLOG_STR_INFO(log, 2, message); + CLOG_STR_DEBUG(log, message); break; case RPT_INFO: case RPT_OPERATOR: diff --git a/source/blender/blenkernel/intern/sound.cc b/source/blender/blenkernel/intern/sound.cc index ebe0b873616..253d6aef8b7 100644 --- a/source/blender/blenkernel/intern/sound.cc +++ b/source/blender/blenkernel/intern/sound.cc @@ -375,7 +375,7 @@ GlobalState g_state; static void sound_device_close_no_lock() { if (g_state.sound_device) { - CLOG_INFO(&LOG, 3, "Closing audio device"); + CLOG_DEBUG(&LOG, "Closing audio device"); AUD_exit(g_state.sound_device); g_state.sound_device = nullptr; } @@ -385,7 +385,7 @@ static void sound_device_open_no_lock(AUD_DeviceSpecs requested_specs) { BLI_assert(!g_state.sound_device); - CLOG_INFO(&LOG, 3, "Opening audio device name:%s", g_state.device_name); + CLOG_DEBUG(&LOG, "Opening audio device name:%s", g_state.device_name); g_state.sound_device = AUD_init( g_state.device_name, requested_specs, g_state.buffer_size, "Blender"); @@ -448,7 +448,7 @@ static void delayed_close_thread_run() while (!g_state.need_exit) { if (!g_state.use_delayed_close) { - CLOG_INFO(&LOG, 3, "Delayed device close is disabled"); + CLOG_DEBUG(&LOG, "Delayed device close is disabled"); /* Don't do anything here as delayed close is disabled. * Wait so that we don't spin around in the while loop. */ g_state.delayed_close_cv.wait(lock); @@ -474,7 +474,7 @@ static void delayed_close_thread_run() } if (g_state.need_exit) { - CLOG_INFO(&LOG, 3, "System exit requested"); + CLOG_DEBUG(&LOG, "System exit requested"); break; } @@ -485,14 +485,14 @@ static void delayed_close_thread_run() } if (!g_state.sound_device) { - CLOG_INFO(&LOG, 3, "Device is not open, nothing to do"); + CLOG_DEBUG(&LOG, "Device is not open, nothing to do"); continue; } - CLOG_INFO(&LOG, 3, "Checking last device usage and timestamp"); + CLOG_DEBUG(&LOG, "Checking last device usage and timestamp"); if (g_state.num_device_users) { - CLOG_INFO(&LOG, 3, "Device is used by %d user(s)", g_state.num_device_users); + CLOG_DEBUG(&LOG, "Device is used by %d user(s)", g_state.num_device_users); continue; } @@ -502,7 +502,7 @@ static void delayed_close_thread_run() } } - CLOG_INFO(&LOG, 3, "Delayed device close thread finished"); + CLOG_DEBUG(&LOG, "Delayed device close thread finished"); } static SoundJackSyncCallback sound_jack_sync_callback = nullptr; @@ -525,7 +525,7 @@ void BKE_sound_init_once() { AUD_initOnce(); if (sound_use_close_thread()) { - CLOG_INFO(&LOG, 2, "Using delayed device close thread"); + CLOG_DEBUG(&LOG, "Using delayed device close thread"); g_state.delayed_close_thread = std::thread(delayed_close_thread_run); } } diff --git a/source/blender/blenkernel/intern/undo_system.cc b/source/blender/blenkernel/intern/undo_system.cc index 838b6427f4c..f9b3a93d976 100644 --- a/source/blender/blenkernel/intern/undo_system.cc +++ b/source/blender/blenkernel/intern/undo_system.cc @@ -161,7 +161,7 @@ static void undosys_id_ref_resolve(void *user_data, UndoRefID *id_ref) static bool undosys_step_encode(bContext *C, Main *bmain, UndoStack *ustack, UndoStep *us) { - CLOG_INFO(&LOG, 2, "addr=%p, name='%s', type='%s'", us, us->name, us->type->name); + CLOG_DEBUG(&LOG, "addr=%p, name='%s', type='%s'", us, us->name, us->type->name); UNDO_NESTED_CHECK_BEGIN; bool ok = us->type->step_encode(C, bmain, us); UNDO_NESTED_CHECK_END; @@ -179,7 +179,7 @@ static bool undosys_step_encode(bContext *C, Main *bmain, UndoStack *ustack, Und #endif } if (ok == false) { - CLOG_INFO(&LOG, 2, "encode callback didn't create undo step"); + CLOG_DEBUG(&LOG, "encode callback didn't create undo step"); } return ok; } @@ -191,7 +191,7 @@ static void undosys_step_decode(bContext *C, const eUndoStepDir dir, bool is_final) { - CLOG_INFO(&LOG, 2, "addr=%p, name='%s', type='%s'", us, us->name, us->type->name); + CLOG_DEBUG(&LOG, "addr=%p, name='%s', type='%s'", us, us->name, us->type->name); if (us->type->step_foreach_ID_ref) { #ifdef WITH_GLOBAL_UNDO_CORRECT_ORDER @@ -231,7 +231,7 @@ static void undosys_step_decode(bContext *C, static void undosys_step_free_and_unlink(UndoStack *ustack, UndoStep *us) { - CLOG_INFO(&LOG, 2, "addr=%p, name='%s', type='%s'", us, us->name, us->type->name); + CLOG_DEBUG(&LOG, "addr=%p, name='%s', type='%s'", us, us->name, us->type->name); UNDO_NESTED_CHECK_BEGIN; us->type->step_free(us); UNDO_NESTED_CHECK_END; @@ -282,7 +282,7 @@ void BKE_undosys_stack_destroy(UndoStack *ustack) void BKE_undosys_stack_clear(UndoStack *ustack) { UNDO_NESTED_ASSERT(false); - CLOG_INFO(&LOG, 2, "steps=%d", BLI_listbase_count(&ustack->steps)); + CLOG_DEBUG(&LOG, "steps=%d", BLI_listbase_count(&ustack->steps)); for (UndoStep *us = static_cast(ustack->steps.last), *us_prev; us; us = us_prev) { us_prev = us->prev; undosys_step_free_and_unlink(ustack, us); @@ -352,7 +352,7 @@ static bool undosys_stack_push_main(UndoStack *ustack, const char *name, Main *b { UNDO_NESTED_ASSERT(false); BLI_assert(ustack->step_init == nullptr); - CLOG_INFO(&LOG, 2, "Push main '%s'", name); + CLOG_DEBUG(&LOG, "Push main '%s'", name); bContext *C_temp = CTX_create(); CTX_data_main_set(C_temp, bmain); eUndoPushReturn ret = BKE_undosys_step_push_with_type( @@ -398,7 +398,7 @@ UndoStep *BKE_undosys_stack_active_with_type(UndoStack *ustack, const UndoType * UndoStep *BKE_undosys_stack_init_or_active_with_type(UndoStack *ustack, const UndoType *ut) { UNDO_NESTED_ASSERT(false); - CLOG_INFO(&LOG, 1, "type='%s'", ut->name); + CLOG_INFO(&LOG, "Initialize type='%s'", ut->name); if (ustack->step_init && (ustack->step_init->type == ut)) { return ustack->step_init; } @@ -412,7 +412,7 @@ void BKE_undosys_stack_limit_steps_and_memory(UndoStack *ustack, int steps, size return; } - CLOG_INFO(&LOG, 2, "Limit steps=%d, memory_limit=%zu", steps, memory_limit); + CLOG_DEBUG(&LOG, "Limit steps=%d, memory_limit=%zu", steps, memory_limit); UndoStep *us; UndoStep *us_exclude = nullptr; /* keep at least two (original + other) */ @@ -422,12 +422,11 @@ void BKE_undosys_stack_limit_steps_and_memory(UndoStack *ustack, int steps, size if (memory_limit) { data_size_all += us->data_size; if (data_size_all > memory_limit) { - CLOG_INFO(&LOG, - 2, - "At step %zu: data_size_all=%zu >= memory_limit=%zu", - us_count, - data_size_all, - memory_limit); + CLOG_DEBUG(&LOG, + "At step %zu: data_size_all=%zu >= memory_limit=%zu", + us_count, + data_size_all, + memory_limit); break; } } @@ -441,7 +440,7 @@ void BKE_undosys_stack_limit_steps_and_memory(UndoStack *ustack, int steps, size } } - CLOG_INFO(&LOG, 2, "Total steps %zu: data_size_all=%zu", us_count, data_size_all); + CLOG_DEBUG(&LOG, "Total steps %zu: data_size_all=%zu", us_count, data_size_all); if (us) { #ifdef WITH_GLOBAL_UNDO_KEEP_ONE @@ -494,7 +493,7 @@ UndoStep *BKE_undosys_step_push_init_with_type(UndoStack *ustack, } us->type = ut; ustack->step_init = us; - CLOG_INFO(&LOG, 2, "addr=%p, name='%s', type='%s'", us, us->name, us->type->name); + CLOG_DEBUG(&LOG, "addr=%p, name='%s', type='%s'", us, us->name, us->type->name); ut->step_encode_init(C, us); undosys_stack_validate(ustack, false); return us; @@ -580,7 +579,7 @@ eUndoPushReturn BKE_undosys_step_push_with_type(UndoStack *ustack, us->use_old_bmain_data = true; /* Initialized, not added yet. */ - CLOG_INFO(&LOG, 2, "addr=%p, name='%s', type='%s'", us, us->name, us->type->name); + CLOG_DEBUG(&LOG, "addr=%p, name='%s', type='%s'", us, us->name, us->type->name); if (!undosys_step_encode(C, G_MAIN, ustack, us)) { MEM_freeN(us); @@ -779,21 +778,19 @@ bool BKE_undosys_step_load_data_ex(UndoStack *ustack, us_target_active = (undo_dir == -1) ? us_target_active->prev : us_target_active->next; } if (us_target_active == nullptr) { - CLOG_INFO(&LOG, - 2, - "undo/redo did not find a step after stepping over skip-steps " - "(undo limit exceeded)"); + CLOG_DEBUG(&LOG, + "undo/redo did not find a step after stepping over skip-steps " + "(undo limit exceeded)"); return false; } } - CLOG_INFO(&LOG, - 2, - "addr=%p, name='%s', type='%s', undo_dir=%d", - us_target, - us_target->name, - us_target->type->name, - undo_dir); + CLOG_DEBUG(&LOG, + "addr=%p, name='%s', type='%s', undo_dir=%d", + us_target, + us_target->name, + us_target->type->name, + undo_dir); /* Undo/Redo steps until we reach given target step (or beyond if it has to be skipped), * from given reference step. */ @@ -807,12 +804,11 @@ bool BKE_undosys_step_load_data_ex(UndoStack *ustack, if (!is_final && is_processing_extra_skipped_steps) { BLI_assert(us_iter->skip == true); - CLOG_INFO(&LOG, - 2, - "undo/redo continue with skip addr=%p, name='%s', type='%s'", - us_iter, - us_iter->name, - us_iter->type->name); + CLOG_DEBUG(&LOG, + "undo/redo continue with skip addr=%p, name='%s', type='%s'", + us_iter, + us_iter->name, + us_iter->type->name); } undosys_step_decode(C, G_MAIN, ustack, us_iter, undo_dir, is_final); diff --git a/source/blender/blenkernel/intern/volume.cc b/source/blender/blenkernel/intern/volume.cc index 6ee33e8df8b..c40b547e38d 100644 --- a/source/blender/blenkernel/intern/volume.cc +++ b/source/blender/blenkernel/intern/volume.cc @@ -493,12 +493,12 @@ bool BKE_volume_load(const Volume *volume, const Main *bmain) char filepath[FILE_MAX]; volume_filepath_get(bmain, volume, filepath); - CLOG_INFO(&LOG, 1, "Volume %s: load %s", volume_name, filepath); + CLOG_INFO(&LOG, "Volume %s: load %s", volume_name, filepath); /* Test if file exists. */ if (!BLI_exists(filepath)) { grids.error_msg = BLI_path_basename(filepath) + std::string(" not found"); - CLOG_INFO(&LOG, 1, "Volume %s: %s", volume_name, grids.error_msg.c_str()); + CLOG_INFO(&LOG, "Volume %s: %s", volume_name, grids.error_msg.c_str()); return false; } @@ -507,7 +507,7 @@ bool BKE_volume_load(const Volume *volume, const Main *bmain) if (!grids_from_file.error_message.empty()) { grids.error_msg = grids_from_file.error_message; - CLOG_INFO(&LOG, 1, "Volume %s: %s", volume_name, grids.error_msg.c_str()); + CLOG_INFO(&LOG, "Volume %s: %s", volume_name, grids.error_msg.c_str()); return false; } @@ -539,7 +539,7 @@ void BKE_volume_unload(Volume *volume) VolumeGridVector &grids = *volume->runtime->grids; if (grids.filepath[0] != '\0') { const char *volume_name = volume->id.name + 2; - CLOG_INFO(&LOG, 1, "Volume %s: unload", volume_name); + CLOG_INFO(&LOG, "Volume %s: unload", volume_name); grids.clear_all(); } #else diff --git a/source/blender/blenloader/intern/readfile.cc b/source/blender/blenloader/intern/readfile.cc index d16344be7d9..a3122bee5b0 100644 --- a/source/blender/blenloader/intern/readfile.cc +++ b/source/blender/blenloader/intern/readfile.cc @@ -560,7 +560,7 @@ static Main *blo_find_main(FileData *fd, const char *filepath, const char *relab if (BLI_path_cmp(filepath_abs, libname) == 0) { if (G.debug & G_DEBUG) { - CLOG_INFO(&LOG, 3, "Found library %s", libname); + CLOG_DEBUG(&LOG, "Found library %s", libname); } return m; } @@ -588,7 +588,7 @@ static Main *blo_find_main(FileData *fd, const char *filepath, const char *relab read_file_version(fd, m); if (G.debug & G_DEBUG) { - CLOG_INFO(&LOG, 3, "Added new lib %s", filepath); + CLOG_DEBUG(&LOG, "Added new lib %s", filepath); } return m; } @@ -998,7 +998,7 @@ static void long_id_names_ensure_unique_id_names(Main *bmain) *bmain, *lb_iter, *id_iter, nullptr, IDNewNameMode::RenameExistingNever, false); BLI_assert(!used_names.contains(id_iter->name)); used_names.add_new(id_iter->name); - CLOG_INFO(&LOG, 3, "ID name has been de-duplicated to '%s'", id_iter->name); + CLOG_DEBUG(&LOG, "ID name has been de-duplicated to '%s'", id_iter->name); } } FOREACH_MAIN_LISTBASE_END; @@ -1029,10 +1029,9 @@ static void long_id_names_process_action_slots_identifiers(Main *bmain) bAction *act = reinterpret_cast(id_iter); for (int i = 0; i < act->slot_array_num; i++) { if (BLI_str_utf8_truncate_at_size(act->slot_array[i]->identifier, MAX_ID_NAME)) { - CLOG_INFO(&LOG, - 4, - "Truncated too long action slot name to '%s'", - act->slot_array[i]->identifier); + CLOG_DEBUG(&LOG, + "Truncated too long action slot name to '%s'", + act->slot_array[i]->identifier); has_truncated_slot_identifer = true; } } @@ -1070,10 +1069,9 @@ static void long_id_names_process_action_slots_identifiers(Main *bmain) } bActionConstraint *constraint_data = static_cast(constraint.data); if (BLI_str_utf8_truncate_at_size(constraint_data->last_slot_identifier, MAX_ID_NAME)) { - CLOG_INFO(&LOG, - 4, - "Truncated too long bActionConstraint.last_slot_identifier to '%s'", - constraint_data->last_slot_identifier); + CLOG_DEBUG(&LOG, + "Truncated too long bActionConstraint.last_slot_identifier to '%s'", + constraint_data->last_slot_identifier); } return true; }; @@ -1095,24 +1093,21 @@ static void long_id_names_process_action_slots_identifiers(Main *bmain) AnimData *anim_data = BKE_animdata_from_id(id_iter); if (anim_data) { if (BLI_str_utf8_truncate_at_size(anim_data->last_slot_identifier, MAX_ID_NAME)) { - CLOG_INFO(&LOG, - 4, - "Truncated too long AnimData.last_slot_identifier to '%s'", - anim_data->last_slot_identifier); + CLOG_DEBUG(&LOG, + "Truncated too long AnimData.last_slot_identifier to '%s'", + anim_data->last_slot_identifier); } if (BLI_str_utf8_truncate_at_size(anim_data->tmp_last_slot_identifier, MAX_ID_NAME)) { - CLOG_INFO(&LOG, - 4, - "Truncated too long AnimData.tmp_last_slot_identifier to '%s'", - anim_data->tmp_last_slot_identifier); + CLOG_DEBUG(&LOG, + "Truncated too long AnimData.tmp_last_slot_identifier to '%s'", + anim_data->tmp_last_slot_identifier); } blender::bke::nla::foreach_strip_adt(*anim_data, [&](NlaStrip *strip) -> bool { if (BLI_str_utf8_truncate_at_size(strip->last_slot_identifier, MAX_ID_NAME)) { - CLOG_INFO(&LOG, - 4, - "Truncated too long NlaStrip.last_slot_identifier to '%s'", - strip->last_slot_identifier); + CLOG_DEBUG(&LOG, + "Truncated too long NlaStrip.last_slot_identifier to '%s'", + strip->last_slot_identifier); } return true; @@ -1947,7 +1942,7 @@ static ID *read_id_struct(FileData *fd, BHead *bh, const char *blockname, const * #long_id_names_ensure_unique_id_names in #blo_read_file_internal. */ if (BLI_str_utf8_truncate_at_size(id->name + 2, MAX_ID_NAME - 2)) { fd->flags |= FD_FLAGS_HAS_INVALID_ID_NAMES; - CLOG_INFO(&LOG, 3, "Truncated too long ID name to '%s'", id->name); + CLOG_DEBUG(&LOG, "Truncated too long ID name to '%s'", id->name); } return id; @@ -2763,10 +2758,10 @@ static bool read_libblock_undo_restore_library(FileData *fd, * That means we have to carefully check whether current lib or * libdata already exits in old main, if it does we merely copy it over into new main area, * otherwise we have to do a full read of that bhead... */ - CLOG_INFO(&LOG_UNDO, 2, "UNDO: restore library %s", id->name); + CLOG_DEBUG(&LOG_UNDO, "UNDO: restore library %s", id->name); if (id_old == nullptr) { - CLOG_INFO(&LOG_UNDO, 2, " -> NO match"); + CLOG_DEBUG(&LOG_UNDO, " -> NO match"); return false; } @@ -2776,11 +2771,10 @@ static bool read_libblock_undo_restore_library(FileData *fd, * modified should not be an issue currently. */ for (Main *libmain : fd->old_bmain->split_mains->as_span().drop_front(1)) { if (&libmain->curlib->id == id_old) { - CLOG_INFO(&LOG_UNDO, - 2, - " compare with %s -> match (existing libpath: %s)", - libmain->curlib ? libmain->curlib->id.name : "", - libmain->curlib ? libmain->curlib->runtime->filepath_abs : ""); + CLOG_DEBUG(&LOG_UNDO, + " compare with %s -> match (existing libpath: %s)", + libmain->curlib ? libmain->curlib->id.name : "", + libmain->curlib ? libmain->curlib->runtime->filepath_abs : ""); /* In case of a library, we need to re-add its main to fd->bmain->split_mains, * because if we have later a missing ID_LINK_PLACEHOLDER, * we need to get the correct lib it is linked to! @@ -2807,7 +2801,7 @@ static ID *library_id_is_yet_read(FileData *fd, Main *mainvar, BHead *bhead); static bool read_libblock_undo_restore_linked( FileData *fd, Main *libmain, const ID *id, ID **r_id_old, BHead *bhead) { - CLOG_INFO(&LOG_UNDO, 2, "UNDO: restore linked datablock %s", id->name); + CLOG_DEBUG(&LOG_UNDO, "UNDO: restore linked datablock %s", id->name); if (*r_id_old == nullptr) { /* If the linked ID had to be re-read at some point, its session_uid may not be the same as @@ -2815,30 +2809,27 @@ static bool read_libblock_undo_restore_linked( *r_id_old = library_id_is_yet_read(fd, libmain, bhead); if (*r_id_old == nullptr) { - CLOG_INFO(&LOG_UNDO, - 2, - " from %s (%s): NOT found", - libmain->curlib ? libmain->curlib->id.name : "", - libmain->curlib ? libmain->curlib->filepath : ""); + CLOG_DEBUG(&LOG_UNDO, + " from %s (%s): NOT found", + libmain->curlib ? libmain->curlib->id.name : "", + libmain->curlib ? libmain->curlib->filepath : ""); return false; } - CLOG_INFO(&LOG_UNDO, - 2, - " from %s (%s): found by name", - libmain->curlib ? libmain->curlib->id.name : "", - libmain->curlib ? libmain->curlib->filepath : ""); + CLOG_DEBUG(&LOG_UNDO, + " from %s (%s): found by name", + libmain->curlib ? libmain->curlib->id.name : "", + libmain->curlib ? libmain->curlib->filepath : ""); /* The Library ID 'owning' this linked ID should already have been moved to new main by a call * to #read_libblock_undo_restore_library. */ BLI_assert(*r_id_old == static_cast(BKE_main_idmap_lookup_uid( fd->new_idmap_uid, (*r_id_old)->session_uid))); } else { - CLOG_INFO(&LOG_UNDO, - 2, - " from %s (%s): found by session_uid", - libmain->curlib ? libmain->curlib->id.name : "", - libmain->curlib ? libmain->curlib->filepath : ""); + CLOG_DEBUG(&LOG_UNDO, + " from %s (%s): found by session_uid", + libmain->curlib ? libmain->curlib->id.name : "", + libmain->curlib ? libmain->curlib->filepath : ""); /* The Library ID 'owning' this linked ID should already have been moved to new main by a call * to #read_libblock_undo_restore_library. */ BLI_assert(*r_id_old == @@ -2979,8 +2970,8 @@ static bool read_libblock_undo_restore( } } else if (id_type->flags & IDTYPE_FLAGS_NO_MEMFILE_UNDO) { - CLOG_INFO( - &LOG_UNDO, 2, "UNDO: skip restore datablock %s, 'NO_MEMFILE_UNDO' type of ID", id->name); + CLOG_DEBUG( + &LOG_UNDO, "UNDO: skip restore datablock %s, 'NO_MEMFILE_UNDO' type of ID", id->name); /* If that local noundo ID still exists currently, the call to * #read_undo_reuse_noundo_local_ids at the beginning of #blo_read_file_internal will already @@ -2998,22 +2989,20 @@ static bool read_libblock_undo_restore( } if (!do_partial_undo) { - CLOG_INFO(&LOG_UNDO, - 2, - "UNDO: read %s (uid %u) -> no partial undo, always read at new address", - id->name, - id->session_uid); + CLOG_DEBUG(&LOG_UNDO, + "UNDO: read %s (uid %u) -> no partial undo, always read at new address", + id->name, + id->session_uid); return false; } /* Restore local datablocks. */ if (id_old != nullptr && read_libblock_is_identical(fd, bhead)) { /* Local datablock was unchanged, restore from the old main. */ - CLOG_INFO(&LOG_UNDO, - 2, - "UNDO: read %s (uid %u) -> keep identical datablock", - id->name, - id->session_uid); + CLOG_DEBUG(&LOG_UNDO, + "UNDO: read %s (uid %u) -> keep identical datablock", + id->name, + id->session_uid); read_libblock_undo_restore_identical(fd, main, id, id_old, bhead, id_tag); @@ -3022,18 +3011,17 @@ static bool read_libblock_undo_restore( } if (id_old != nullptr) { /* Local datablock was changed. Restore at the address of the old datablock. */ - CLOG_INFO(&LOG_UNDO, - 2, - "UNDO: read %s (uid %u) -> read to old existing address", - id->name, - id->session_uid); + CLOG_DEBUG(&LOG_UNDO, + "UNDO: read %s (uid %u) -> read to old existing address", + id->name, + id->session_uid); *r_id_old = id_old; return false; } /* Local datablock does not exist in the undo step, so read from scratch. */ - CLOG_INFO( - &LOG_UNDO, 2, "UNDO: read %s (uid %u) -> read at new address", id->name, id->session_uid); + CLOG_DEBUG( + &LOG_UNDO, "UNDO: read %s (uid %u) -> read at new address", id->name, id->session_uid); return false; } @@ -3314,9 +3302,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) STRNCPY(build_commit_datetime, "unknown"); } - CLOG_INFO(&LOG, 0, "Read file %s", fd->relabase); + CLOG_INFO(&LOG, "Read file %s", fd->relabase); CLOG_INFO(&LOG, - 0, " Version %d sub %d date %s hash %s", main->versionfile, main->subversionfile, @@ -3379,13 +3366,12 @@ static void do_versions_after_linking(FileData *fd, Main *main) { BLI_assert(fd != nullptr); - CLOG_INFO(&LOG, - 2, - "Processing %s (%s), %d.%d", - main->curlib ? main->curlib->filepath : main->filepath, - main->curlib ? "LIB" : "MAIN", - main->versionfile, - main->subversionfile); + CLOG_DEBUG(&LOG, + "Processing %s (%s), %d.%d", + main->curlib ? main->curlib->filepath : main->filepath, + main->curlib ? "LIB" : "MAIN", + main->versionfile, + main->subversionfile); /* Don't allow versioning to create new data-blocks. */ main->is_locked_for_linking = true; @@ -3753,7 +3739,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath) const bool is_undo = (fd->flags & FD_FLAGS_IS_MEMFILE) != 0; if (is_undo) { - CLOG_INFO(&LOG_UNDO, 2, "UNDO: read step"); + CLOG_DEBUG(&LOG_UNDO, "UNDO: read step"); } /* Prevent any run of layer collections rebuild during readfile process, and the do_versions @@ -4851,13 +4837,12 @@ static void read_library_linked_id( read_libblock(fd, mainvar, bhead, id->tag, BLO_readfile_id_runtime_tags(*id), false, r_id); } else { - CLOG_INFO(&LOG, - 3, - "LIB: %s: '%s' missing from '%s', parent '%s'", - BKE_idtype_idcode_to_name(GS(id->name)), - id->name + 2, - mainvar->curlib->runtime->filepath_abs, - library_parent_filepath(mainvar->curlib)); + CLOG_DEBUG(&LOG, + "LIB: %s: '%s' missing from '%s', parent '%s'", + BKE_idtype_idcode_to_name(GS(id->name)), + id->name + 2, + mainvar->curlib->runtime->filepath_abs, + library_parent_filepath(mainvar->curlib)); basefd->reports->count.missing_linked_id++; /* Generate a placeholder for this ID (simplified version of read_libblock actually...). */ @@ -4954,7 +4939,7 @@ static void read_library_clear_weak_links(FileData *basefd, Main *mainvar) if (BLO_readfile_id_runtime_tags(*id).is_link_placeholder && (id->flag & ID_FLAG_INDIRECT_WEAK_LINK)) { - CLOG_INFO(&LOG, 3, "Dropping weak link to '%s'", id->name); + CLOG_DEBUG(&LOG, "Dropping weak link to '%s'", id->name); change_link_placeholder_to_real_ID_pointer(basefd, id, nullptr); BLI_freelinkN(lbarray[a], id); } @@ -5059,11 +5044,10 @@ static void read_libraries(FileData *basefd) Main *libmain = (*bmain->split_mains)[i]; /* Does this library have any more linked data-blocks we need to read? */ if (has_linked_ids_to_read(libmain)) { - CLOG_INFO(&LOG, - 3, - "Reading linked data-blocks from %s (%s)", - libmain->curlib->id.name, - libmain->curlib->filepath); + CLOG_DEBUG(&LOG, + "Reading linked data-blocks from %s (%s)", + libmain->curlib->id.name, + libmain->curlib->filepath); /* Open file if it has not been done yet. */ FileData *fd = read_library_file_data(basefd, bmain, libmain); diff --git a/source/blender/blentranslation/intern/messages.cc b/source/blender/blentranslation/intern/messages.cc index c80b3ef5193..0612eee91a6 100644 --- a/source/blender/blentranslation/intern/messages.cc +++ b/source/blender/blentranslation/intern/messages.cc @@ -562,7 +562,7 @@ class MOMessages { return false; } - CLOG_INFO(&LOG, 1, "Load messages from \"%s\"", filepath.c_str()); + CLOG_INFO(&LOG, "Load messages from \"%s\"", filepath.c_str()); /* Create context + key to translated string mapping. */ for (size_t i = 0; i < mo.size(); i++) { @@ -603,7 +603,7 @@ void init(const StringRef locale_full_name, global_full_name = info.to_full_name(); if (global_messages->error().empty()) { - CLOG_INFO(&LOG, 1, "Locale %s used for translation", global_full_name.c_str()); + CLOG_INFO(&LOG, "Locale %s used for translation", global_full_name.c_str()); } else { CLOG_ERROR(&LOG, "Locale %s: %s", global_full_name.c_str(), global_messages->error().c_str()); diff --git a/source/blender/editors/animation/anim_motion_paths.cc b/source/blender/editors/animation/anim_motion_paths.cc index da2fde56b2f..a0e9b03c63c 100644 --- a/source/blender/editors/animation/anim_motion_paths.cc +++ b/source/blender/editors/animation/anim_motion_paths.cc @@ -521,7 +521,6 @@ void animviz_calc_motionpaths(Depsgraph *depsgraph, /* Calculate path over requested range. */ CLOG_INFO(&LOG, - 1, "Calculating MotionPaths between frames %d - %d (%d frames)", sfra, efra, diff --git a/source/blender/editors/asset/intern/asset_indexer.cc b/source/blender/editors/asset/intern/asset_indexer.cc index ea0ee6ee6f2..fcc2b4977d9 100644 --- a/source/blender/editors/asset/intern/asset_indexer.cc +++ b/source/blender/editors/asset/intern/asset_indexer.cc @@ -418,7 +418,7 @@ struct AssetLibraryIndex { } const std::string &file_path = preexisting_index.key; - CLOG_INFO(&LOG, 2, "Remove unused index file \"%s\".", file_path.c_str()); + CLOG_DEBUG(&LOG, "Remove unused index file \"%s\".", file_path.c_str()); files_to_remove.add(preexisting_index.key); } @@ -629,7 +629,7 @@ int AssetLibraryIndex::remove_broken_index_files() continue; } if (IN_RANGE(stat.st_mtime, timestamp_from, timestamp_to)) { - CLOG_INFO(&LOG, 2, "Remove potentially broken index file \"%s\".", index_path.c_str()); + CLOG_DEBUG(&LOG, "Remove potentially broken index file \"%s\".", index_path.c_str()); files_to_remove.add(index_path); } } @@ -664,9 +664,8 @@ static eFileIndexerResult read_index(const char *filename, asset_index_file.mark_as_used(); if (asset_index_file.is_older_than(asset_file)) { - CLOG_INFO( + CLOG_DEBUG( &LOG, - 3, "Asset index file \"%s\" needs to be refreshed as it is older than the asset file \"%s\".", asset_index_file.filename.c_str(), filename); @@ -674,32 +673,30 @@ static eFileIndexerResult read_index(const char *filename, } if (!asset_index_file.constains_entries()) { - CLOG_INFO(&LOG, - 3, - "Asset file index is to small to contain any entries. \"%s\"", - asset_index_file.filename.c_str()); + CLOG_DEBUG(&LOG, + "Asset file index is to small to contain any entries. \"%s\"", + asset_index_file.filename.c_str()); *r_read_entries_len = 0; return FILE_INDEXER_ENTRIES_LOADED; } std::unique_ptr contents = asset_index_file.read_contents(); if (!contents) { - CLOG_INFO(&LOG, 3, "Asset file index is ignored; failed to read contents."); + CLOG_DEBUG(&LOG, "Asset file index is ignored; failed to read contents."); return FILE_INDEXER_NEEDS_UPDATE; } if (!contents->is_latest_version()) { - CLOG_INFO(&LOG, - 3, - "Asset file index is ignored; expected version %d but file is version %d \"%s\".", - AssetIndex::CURRENT_VERSION, - contents->get_version(), - asset_index_file.filename.c_str()); + CLOG_DEBUG(&LOG, + "Asset file index is ignored; expected version %d but file is version %d \"%s\".", + AssetIndex::CURRENT_VERSION, + contents->get_version(), + asset_index_file.filename.c_str()); return FILE_INDEXER_NEEDS_UPDATE; } const int read_entries_len = contents->extract_into(*entries); - CLOG_INFO(&LOG, 1, "Read %d entries for \"%s\".", read_entries_len, filename); + CLOG_INFO(&LOG, "Read %d entries for \"%s\".", read_entries_len, filename); *r_read_entries_len = read_entries_len; return FILE_INDEXER_ENTRIES_LOADED; @@ -711,7 +708,6 @@ static void update_index(const char *filename, FileIndexerEntries *entries, void BlendFile asset_file(filename); AssetIndexFile asset_index_file(library_index, asset_file); CLOG_INFO(&LOG, - 1, "Update for \"%s\" store index in \"%s\".", asset_file.get_file_path(), asset_index_file.get_file_path()); @@ -739,7 +735,7 @@ static void filelist_finished(void *user_data) AssetLibraryIndex &library_index = *static_cast(user_data); const int num_indices_removed = library_index.remove_unused_index_files(); if (num_indices_removed > 0) { - CLOG_INFO(&LOG, 1, "Removed %d unused indices.", num_indices_removed); + CLOG_INFO(&LOG, "Removed %d unused indices.", num_indices_removed); } } diff --git a/source/blender/editors/id_management/ed_id_management.cc b/source/blender/editors/id_management/ed_id_management.cc index a476d46f0fd..9ad5705caa8 100644 --- a/source/blender/editors/id_management/ed_id_management.cc +++ b/source/blender/editors/id_management/ed_id_management.cc @@ -30,26 +30,24 @@ bool ED_id_rename(Main &bmain, ID &id, blender::StringRefNull name) switch (result.action) { case IDNewNameResult::Action::UNCHANGED: - CLOG_INFO(&LOG, 4, "ID '%s' not renamed, already using the requested name", id.name + 2); + CLOG_DEBUG(&LOG, "ID '%s' not renamed, already using the requested name", id.name + 2); return false; case IDNewNameResult::Action::UNCHANGED_COLLISION: - CLOG_INFO(&LOG, - 4, - "ID '%s' not renamed, requested new name '%s' would collide with an existing one", - id.name + 2, - name.c_str()); + CLOG_DEBUG(&LOG, + "ID '%s' not renamed, requested new name '%s' would collide with an existing one", + id.name + 2, + name.c_str()); return false; case IDNewNameResult::Action::RENAMED_NO_COLLISION: - CLOG_INFO(&LOG, 4, "ID '%s' renamed without any collision", id.name + 2); + CLOG_DEBUG(&LOG, "ID '%s' renamed without any collision", id.name + 2); WM_main_add_notifier(NC_ID | NA_RENAME, &id); return true; case IDNewNameResult::Action::RENAMED_COLLISION_ADJUSTED: - CLOG_INFO(&LOG, - 4, - "ID '%s' renamed with adjustment from requested name '%s', to avoid name " - "collision with another ID", - id.name + 2, - name.c_str()); + CLOG_DEBUG(&LOG, + "ID '%s' renamed with adjustment from requested name '%s', to avoid name " + "collision with another ID", + id.name + 2, + name.c_str()); WM_global_reportf(RPT_INFO, "Data-block renamed to '%s', try again to force renaming it to '%s'", id.name + 2, @@ -57,9 +55,8 @@ bool ED_id_rename(Main &bmain, ID &id, blender::StringRefNull name) WM_main_add_notifier(NC_ID | NA_RENAME, &id); return true; case IDNewNameResult::Action::RENAMED_COLLISION_FORCED: - CLOG_INFO( + CLOG_DEBUG( &LOG, - 4, "ID '%s' forcefully renamed, another ID had to also be renamed to avoid name collision", id.name + 2); WM_global_reportf(RPT_INFO, diff --git a/source/blender/editors/sculpt_paint/sculpt_detail.cc b/source/blender/editors/sculpt_paint/sculpt_detail.cc index 0fd2e6c0ed4..8c88abda1a9 100644 --- a/source/blender/editors/sculpt_paint/sculpt_detail.cc +++ b/source/blender/editors/sculpt_paint/sculpt_detail.cc @@ -156,7 +156,7 @@ static wmOperatorStatus sculpt_detail_flood_fill_exec(bContext *C, wmOperator *o node_mask.foreach_index([&](const int i) { BKE_pbvh_node_mark_topology_update(nodes[i]); }); } - CLOG_INFO(&LOG, 2, "Detail flood fill took %f seconds.", BLI_time_now_seconds() - start_time); + CLOG_DEBUG(&LOG, "Detail flood fill took %f seconds.", BLI_time_now_seconds() - start_time); undo::push_end(ob); diff --git a/source/blender/editors/undo/ed_undo.cc b/source/blender/editors/undo/ed_undo.cc index aa8de5f99d6..f0f53c64d80 100644 --- a/source/blender/editors/undo/ed_undo.cc +++ b/source/blender/editors/undo/ed_undo.cc @@ -96,7 +96,7 @@ void ED_undo_group_end(bContext *C) void ED_undo_push(bContext *C, const char *str) { - CLOG_INFO(&LOG, 1, "Push '%s'", str); + CLOG_INFO(&LOG, "Push '%s'", str); WM_file_tag_modified(); wmWindowManager *wm = CTX_wm_manager(C); @@ -139,7 +139,7 @@ void ED_undo_push(bContext *C, const char *str) BKE_undosys_stack_limit_steps_and_memory(wm->undo_stack, -1, memory_limit); } - if (CLOG_CHECK(&LOG, 2)) { + if (CLOG_CHECK(&LOG, CLG_LEVEL_DEBUG)) { BKE_undosys_print(wm->undo_stack); } @@ -222,7 +222,7 @@ static void ed_undo_step_post(bContext *C, asset::list::storage_tag_main_data_dirty(); - if (CLOG_CHECK(&LOG, 2)) { + if (CLOG_CHECK(&LOG, CLG_LEVEL_DEBUG)) { BKE_undosys_print(wm->undo_stack); } } @@ -238,7 +238,7 @@ static wmOperatorStatus ed_undo_step_direction(bContext *C, { BLI_assert(ELEM(step, STEP_UNDO, STEP_REDO)); - CLOG_INFO(&LOG, 1, "direction=%s", (step == STEP_UNDO) ? "STEP_UNDO" : "STEP_REDO"); + CLOG_INFO(&LOG, "Step direction=%s", (step == STEP_UNDO) ? "STEP_UNDO" : "STEP_REDO"); wmWindowManager *wm = CTX_wm_manager(C); @@ -286,8 +286,7 @@ static int ed_undo_step_by_name(bContext *C, const char *undo_name, ReportList * const enum eUndoStepDir undo_dir = (undo_dir_i == -1) ? STEP_UNDO : STEP_REDO; CLOG_INFO(&LOG, - 1, - "name='%s', found direction=%s", + "Step name='%s', found direction=%s", undo_name, (undo_dir == STEP_UNDO) ? "STEP_UNDO" : "STEP_REDO"); @@ -317,8 +316,7 @@ static int ed_undo_step_by_index(bContext *C, const int undo_index, ReportList * const enum eUndoStepDir undo_dir = (undo_index < active_step_index) ? STEP_UNDO : STEP_REDO; CLOG_INFO(&LOG, - 1, - "index='%d', found direction=%s", + "Step index='%d', found direction=%s", undo_index, (undo_dir == STEP_UNDO) ? "STEP_UNDO" : "STEP_REDO"); @@ -419,7 +417,7 @@ bool ED_undo_is_legacy_compatible_for_property(bContext *C, ID *id, PointerRNA & /* For all non-weight-paint paint modes: Don't store property changes when painting. * Weight Paint and Vertex Paint use global undo, and thus don't need to be special-cased * here. */ - CLOG_INFO(&LOG, 1, "skipping undo for paint-mode"); + CLOG_DEBUG(&LOG, "skipping undo for paint-mode"); return false; } if (obact->mode & OB_MODE_EDIT) { @@ -427,7 +425,7 @@ bool ED_undo_is_legacy_compatible_for_property(bContext *C, ID *id, PointerRNA & (GS(id->name) != GS(((ID *)obact->data)->name))) { /* No undo push on id type mismatch in edit-mode. */ - CLOG_INFO(&LOG, 1, "skipping undo for edit-mode"); + CLOG_DEBUG(&LOG, "skipping undo for edit-mode"); return false; } } @@ -630,7 +628,7 @@ bool ED_undo_operator_repeat(bContext *C, wmOperator *op) bool success = false; if (op) { - CLOG_INFO(&LOG, 1, "operator repeat idname='%s'", op->type->idname); + CLOG_INFO(&LOG, "Operator repeat idname='%s'", op->type->idname); wmWindowManager *wm = CTX_wm_manager(C); const ScrArea *area = CTX_wm_area(C); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/gpu/intern/gpu_shader_log.cc b/source/blender/gpu/intern/gpu_shader_log.cc index 0894d4e6cb6..089477a5bb0 100644 --- a/source/blender/gpu/intern/gpu_shader_log.cc +++ b/source/blender/gpu/intern/gpu_shader_log.cc @@ -246,16 +246,14 @@ void Shader::print_log(Span sources, previous_location = log_item.cursor; } - CLG_Severity severity = error ? CLG_SEVERITY_ERROR : CLG_SEVERITY_WARN; + CLG_Level level = error ? CLG_LEVEL_ERROR : CLG_LEVEL_WARN; - if (((LOG.type->flag & CLG_FLAG_USE) && (LOG.type->level >= 0)) || - (severity >= CLG_SEVERITY_WARN)) - { + if (CLOG_CHECK(&LOG, CLG_LEVEL_INFO) && level >= CLG_LEVEL_WARN) { if (DEBUG_LOG_SHADER_SRC_ON_ERROR && error) { - CLG_log_str(LOG.type, severity, this->name, stage, sources_combined.c_str()); + CLG_log_str(LOG.type, level, this->name, stage, sources_combined.c_str()); } const char *_str = BLI_dynstr_get_cstring(dynstr); - CLG_log_str(LOG.type, severity, this->name, stage, _str); + CLG_log_str(LOG.type, level, this->name, stage, _str); MEM_freeN(_str); } diff --git a/source/blender/gpu/metal/mtl_batch.mm b/source/blender/gpu/metal/mtl_batch.mm index cbcd92eea1a..92a9f1f63de 100644 --- a/source/blender/gpu/metal/mtl_batch.mm +++ b/source/blender/gpu/metal/mtl_batch.mm @@ -149,7 +149,7 @@ int MTLBatch::prepare_vertex_binding(MTLVertBuf *verts, /* Check if attribute is already present in the given slot. */ if ((~attr_mask) & (1 << mtl_attr.location)) { - MTL_LOG_INFO( + MTL_LOG_DEBUG( " -- [Batch] Skipping attribute with input location %d (As one is already bound)", mtl_attr.location); } @@ -169,10 +169,10 @@ int MTLBatch::prepare_vertex_binding(MTLVertBuf *verts, desc.vertex_descriptor.num_vert_buffers++; buffer_added = true; - MTL_LOG_INFO(" -- [Batch] Adding source %s buffer (Index: %d, Stride: %d)", - (instanced) ? "instance" : "vertex", - buffer_index, - buffer_stride); + MTL_LOG_DEBUG(" -- [Batch] Adding source %s buffer (Index: %d, Stride: %d)", + (instanced) ? "instance" : "vertex", + buffer_index, + buffer_stride); } else { /* Ensure stride is correct for de-interleaved attributes. */ @@ -248,7 +248,7 @@ int MTLBatch::prepare_vertex_binding(MTLVertBuf *verts, /* NOTE: We are setting max_attribute_value to be up to the maximum found index, because * of this, it is possible that we may skip over certain attributes if they were not in * the source GPUVertFormat. */ - MTL_LOG_INFO( + MTL_LOG_DEBUG( " -- Batch Attribute(%d): ORIG Shader Format: %d, ORIG Vert format: %d, Vert " "components: %d, Fetch Mode %d --> FINAL FORMAT: %d", mtl_attr.location, @@ -258,7 +258,7 @@ int MTLBatch::prepare_vertex_binding(MTLVertBuf *verts, (int)a->type.fetch_mode(), (int)desc.vertex_descriptor.attributes[mtl_attr.location].format); - MTL_LOG_INFO( + MTL_LOG_DEBUG( " -- [Batch] matching %s attribute '%s' (Attribute Index: %d, Buffer index: %d, " "offset: %d)", (instanced) ? "instance" : "vertex", @@ -461,7 +461,7 @@ void MTLBatch::prepare_vertex_descriptor_and_bindings(MTLVertBuf **buffers, int /* Extract Instance attributes (These take highest priority). */ for (int v = 0; v < GPU_BATCH_INST_VBO_MAX_LEN; v++) { if (mtl_inst[v]) { - MTL_LOG_INFO(" -- [Batch] Checking bindings for bound instance buffer %p", mtl_inst[v]); + MTL_LOG_DEBUG(" -- [Batch] Checking bindings for bound instance buffer %p", mtl_inst[v]); int buffer_ind = this->prepare_vertex_binding( mtl_inst[v], desc, interface, attr_mask, true); if (buffer_ind >= 0) { @@ -479,7 +479,7 @@ void MTLBatch::prepare_vertex_descriptor_and_bindings(MTLVertBuf **buffers, int /* Extract Vertex attributes (First-bound vertex buffer takes priority). */ for (int v = 0; v < GPU_BATCH_VBO_MAX_LEN; v++) { if (mtl_verts[v] != nullptr) { - MTL_LOG_INFO(" -- [Batch] Checking bindings for bound vertex buffer %p", mtl_verts[v]); + MTL_LOG_DEBUG(" -- [Batch] Checking bindings for bound vertex buffer %p", mtl_verts[v]); int buffer_ind = this->prepare_vertex_binding( mtl_verts[v], desc, interface, attr_mask, false); if (buffer_ind >= 0) { diff --git a/source/blender/gpu/metal/mtl_context.mm b/source/blender/gpu/metal/mtl_context.mm index b45dcc09a65..9f4b4fd8812 100644 --- a/source/blender/gpu/metal/mtl_context.mm +++ b/source/blender/gpu/metal/mtl_context.mm @@ -102,7 +102,7 @@ void MTLContext::set_ghost_context(GHOST_ContextHandle ghostCtxHandle) if (ghost_cgl_ctx != nullptr) { default_fbo_mtltexture_ = ghost_cgl_ctx->metalOverlayTexture(); - MTL_LOG_INFO( + MTL_LOG_DEBUG( "Binding GHOST context CGL %p to GPU context %p. (Device: %p, queue: %p, texture: %p)", ghost_cgl_ctx, this, @@ -143,7 +143,7 @@ void MTLContext::set_ghost_context(GHOST_ContextHandle ghostCtxHandle) } mtl_back_left->add_color_attachment(default_fbo_gputexture_, 0, 0, 0); - MTL_LOG_INFO( + MTL_LOG_DEBUG( "-- Bound context %p for GPU context: %p is offscreen and does not have a default " "framebuffer", ghost_cgl_ctx, @@ -154,7 +154,7 @@ void MTLContext::set_ghost_context(GHOST_ContextHandle ghostCtxHandle) } } else { - MTL_LOG_INFO( + MTL_LOG_DEBUG( " Failed to bind GHOST context to MTLContext -- GHOST_ContextCGL is null " "(GhostContext: %p, GhostContext_CGL: %p)", ghost_ctx, @@ -995,8 +995,8 @@ bool MTLContext::ensure_render_pipeline_state(MTLPrimitiveType mtl_prim_type) /* Bind Null attribute buffer, if needed. */ if (pipeline_state_instance->null_attribute_buffer_index >= 0) { if (G.debug & G_DEBUG_GPU) { - MTL_LOG_INFO("Binding null attribute buffer at index: %d", - pipeline_state_instance->null_attribute_buffer_index); + MTL_LOG_DEBUG("Binding null attribute buffer at index: %d", + pipeline_state_instance->null_attribute_buffer_index); } rps.bind_vertex_buffer(this->get_null_attribute_buffer(), 0, @@ -2702,8 +2702,8 @@ void present(MTLRenderPassDescriptor *blit_descriptor, /* Decrement count */ ctx->main_command_buffer.dec_active_command_buffer_count(); - MTL_LOG_INFO("Active command buffers: %d", - int(MTLCommandBufferManager::num_active_cmd_bufs_in_system)); + MTL_LOG_DEBUG("Active command buffers: %d", + int(MTLCommandBufferManager::num_active_cmd_bufs_in_system)); /* Drawable count and latency management. */ MTLContext::max_drawables_in_flight--; @@ -2713,10 +2713,10 @@ void present(MTLRenderPassDescriptor *blit_descriptor, .count(); MTLContext::latency_resolve_average(microseconds_per_frame); - MTL_LOG_INFO("Frame Latency: %f ms (Rolling avg: %f ms Drawables: %d)", - ((float)microseconds_per_frame) / 1000.0f, - ((float)MTLContext::avg_drawable_latency_us) / 1000.0f, - perf_max_drawables); + MTL_LOG_DEBUG("Frame Latency: %f ms (Rolling avg: %f ms Drawables: %d)", + ((float)microseconds_per_frame) / 1000.0f, + ((float)MTLContext::avg_drawable_latency_us) / 1000.0f, + perf_max_drawables); }]; [cmdbuf commit]; diff --git a/source/blender/gpu/metal/mtl_debug.hh b/source/blender/gpu/metal/mtl_debug.hh index 6cee3c98b1e..89f2eaf18bb 100644 --- a/source/blender/gpu/metal/mtl_debug.hh +++ b/source/blender/gpu/metal/mtl_debug.hh @@ -46,10 +46,10 @@ void mtl_debug_init(); } \ } -#define MTL_LOG_INFO(info, ...) \ +#define MTL_LOG_DEBUG(info, ...) \ { \ if (G.debug & G_DEBUG_GPU) { \ - CLOG_INFO(&debug::LOG, 2, info EXPAND_ARGS(__VA_ARGS__)); \ + CLOG_DEBUG(&debug::LOG, info EXPAND_ARGS(__VA_ARGS__)); \ } \ } diff --git a/source/blender/gpu/metal/mtl_index_buffer.mm b/source/blender/gpu/metal/mtl_index_buffer.mm index 13c36fefb82..8909439fbf2 100644 --- a/source/blender/gpu/metal/mtl_index_buffer.mm +++ b/source/blender/gpu/metal/mtl_index_buffer.mm @@ -115,7 +115,7 @@ void MTLIndexBuf::upload_data() /* If new data ready, and index buffer already exists, release current. */ if ((ibo_ != nullptr) && (this->data_ != nullptr)) { - MTL_LOG_INFO("Re-creating index buffer with new data. IndexBuf %p", this); + MTL_LOG_DEBUG("Re-creating index buffer with new data. IndexBuf %p", this); ibo_->free(); ibo_ = nullptr; } @@ -460,7 +460,7 @@ id MTLIndexBuf::get_index_buffer(GPUPrimType &in_out_primitive_type, /* TODO(Metal): Line strip topology types would benefit from optimization to remove * primitive restarts, however, these do not occur frequently, nor with * significant geometry counts. */ - MTL_LOG_INFO("TODO: Primitive topology: Optimize line strip topology types"); + MTL_LOG_DEBUG("TODO: Primitive topology: Optimize line strip topology types"); } break; case GPU_PRIM_LINE_LOOP: { diff --git a/source/blender/gpu/metal/mtl_memory.mm b/source/blender/gpu/metal/mtl_memory.mm index 4259f1a867e..c676c05b40a 100644 --- a/source/blender/gpu/metal/mtl_memory.mm +++ b/source/blender/gpu/metal/mtl_memory.mm @@ -159,7 +159,7 @@ gpu::MTLBuffer *MTLBufferPool::allocate_aligned(uint64_t size, if (found_size >= aligned_alloc_size && found_size <= (aligned_alloc_size * mtl_buffer_size_threshold_factor_)) { - MTL_LOG_INFO( + MTL_LOG_DEBUG( "[MemoryAllocator] Suitable Buffer of size %lld found, for requested size: %lld", found_size, aligned_alloc_size); @@ -171,7 +171,7 @@ gpu::MTLBuffer *MTLBufferPool::allocate_aligned(uint64_t size, pool->erase(result); } else { - MTL_LOG_INFO( + MTL_LOG_DEBUG( "[MemoryAllocator] Buffer of size %lld found, but was incompatible with requested " "size: %lld", found_size, @@ -904,10 +904,10 @@ void MTLScratchBufferManager::ensure_increment_scratch_buffer() active_scratch_buf = scratch_buffers_[current_scratch_buffer_]; active_scratch_buf->reset(); BLI_assert(&active_scratch_buf->own_context_ == &context_); - MTL_LOG_INFO("Scratch buffer %d reset - (ctx %p)(Frame index: %d)", - current_scratch_buffer_, - &context_, - context_.get_current_frame_index()); + MTL_LOG_DEBUG("Scratch buffer %d reset - (ctx %p)(Frame index: %d)", + current_scratch_buffer_, + &context_, + context_.get_current_frame_index()); } } @@ -1005,11 +1005,12 @@ MTLTemporaryBuffer MTLCircularBuffer::allocate_range_aligned(uint64_t alloc_size * maximum */ if (aligned_alloc_size > MTLScratchBufferManager::mtl_scratch_buffer_max_size_) { new_size = aligned_alloc_size; - MTL_LOG_INFO("Temporarily growing Scratch buffer to %d MB", (int)new_size / 1024 / 1024); + MTL_LOG_DEBUG("Temporarily growing Scratch buffer to %d MB", + (int)new_size / 1024 / 1024); } else { new_size = MTLScratchBufferManager::mtl_scratch_buffer_max_size_; - MTL_LOG_INFO("Shrinking Scratch buffer back to %d MB", (int)new_size / 1024 / 1024); + MTL_LOG_DEBUG("Shrinking Scratch buffer back to %d MB", (int)new_size / 1024 / 1024); } } BLI_assert(aligned_alloc_size <= new_size); @@ -1061,7 +1062,7 @@ MTLTemporaryBuffer MTLCircularBuffer::allocate_range_aligned(uint64_t alloc_size if (G.debug & G_DEBUG_GPU) { cbuffer_->set_label(@"Circular Scratch Buffer"); } - MTL_LOG_INFO("Resized Metal circular buffer to %llu bytes", new_size); + MTL_LOG_DEBUG("Resized Metal circular buffer to %llu bytes", new_size); /* Reset allocation Status. */ aligned_current_offset = 0; diff --git a/source/blender/gpu/metal/mtl_shader.mm b/source/blender/gpu/metal/mtl_shader.mm index 78d40b466a8..14dd8cdc939 100644 --- a/source/blender/gpu/metal/mtl_shader.mm +++ b/source/blender/gpu/metal/mtl_shader.mm @@ -1074,8 +1074,8 @@ MTLRenderPipelineStateInstance *MTLShader::bake_pipeline_state( } using_null_buffer = true; #if MTL_DEBUG_SHADER_ATTRIBUTES == 1 - MTL_LOG_INFO("Setting up buffer binding for null attribute with buffer index %d", - null_buffer_index); + MTL_LOG_DEBUG("Setting up buffer binding for null attribute with buffer index %d", + null_buffer_index); #endif } } @@ -1468,9 +1468,9 @@ MTLComputePipelineStateInstance *MTLShader::bake_compute_pipeline_state( if (ELEM(capabilities.gpu, APPLE_GPU_M1, APPLE_GPU_M2)) { if (maxTotalThreadsPerThreadgroup_Tuning_ > 0) { desc.maxTotalThreadsPerThreadgroup = this->maxTotalThreadsPerThreadgroup_Tuning_; - MTL_LOG_INFO("Using custom parameter for shader %s value %u\n", - this->name, - maxTotalThreadsPerThreadgroup_Tuning_); + MTL_LOG_DEBUG("Using custom parameter for shader %s value %u\n", + this->name, + maxTotalThreadsPerThreadgroup_Tuning_); } } diff --git a/source/blender/gpu/metal/mtl_shader_interface.mm b/source/blender/gpu/metal/mtl_shader_interface.mm index 06dccd73d1c..8f0d337d427 100644 --- a/source/blender/gpu/metal/mtl_shader_interface.mm +++ b/source/blender/gpu/metal/mtl_shader_interface.mm @@ -282,10 +282,10 @@ void MTLShaderInterface::map_builtins() BLI_assert(uni->location >= 0); if (uni->location >= 0) { builtins_[u] = uni->location; - MTL_LOG_INFO("Mapped builtin uniform '%s' NB: '%s' to location: %d", - builtin_uniform_name((GPUUniformBuiltin)u), - get_name_at_offset(uni->name_offset), - uni->location); + MTL_LOG_DEBUG("Mapped builtin uniform '%s' NB: '%s' to location: %d", + builtin_uniform_name((GPUUniformBuiltin)u), + get_name_at_offset(uni->name_offset), + uni->location); } } } @@ -298,9 +298,9 @@ void MTLShaderInterface::map_builtins() BLI_assert(uni->location >= 0); if (uni->location >= 0) { builtin_blocks_[u] = uni->binding; - MTL_LOG_INFO("Mapped builtin uniform block '%s' to location %d", - builtin_uniform_block_name((GPUUniformBlockBuiltin)u), - uni->location); + MTL_LOG_DEBUG("Mapped builtin uniform block '%s' to location %d", + builtin_uniform_block_name((GPUUniformBlockBuiltin)u), + uni->location); } } } diff --git a/source/blender/gpu/metal/mtl_texture.mm b/source/blender/gpu/metal/mtl_texture.mm index b90c65b4736..b8237c6f311 100644 --- a/source/blender/gpu/metal/mtl_texture.mm +++ b/source/blender/gpu/metal/mtl_texture.mm @@ -214,7 +214,7 @@ void gpu::MTLTexture::bake_mip_swizzle_view() levels:NSMakeRange(mip_texture_base_level_, range_len) slices:NSMakeRange(mip_texture_base_layer_, num_slices) swizzle:mtl_swizzle_mask_]; - MTL_LOG_INFO( + MTL_LOG_DEBUG( "Updating texture view - MIP TEXTURE BASE LEVEL: %d, MAX LEVEL: %d (Range len: %d)", mip_texture_base_level_, min_ii(mip_texture_max_level_, (int)texture_.mipmapLevelCount), @@ -251,7 +251,7 @@ id gpu::MTLTexture::get_metal_handle() /* Source vertex buffer has been re-generated, require re-initialization. */ if (buf != vert_buffer_mtl_) { - MTL_LOG_INFO( + MTL_LOG_DEBUG( "MTLTexture '%p' using MTL_TEXTURE_MODE_VBO requires re-generation due to updated " "Vertex-Buffer.", this); @@ -1977,7 +1977,7 @@ void gpu::MTLTexture::read_internal(int mip, texture_array_relative_offset += bytes_per_image; } - MTL_LOG_INFO("Copying texture data to buffer GPU_TEXTURE_CUBE_ARRAY"); + MTL_LOG_DEBUG("Copying texture data to buffer GPU_TEXTURE_CUBE_ARRAY"); copy_successful = true; } else { @@ -2009,7 +2009,7 @@ void gpu::MTLTexture::read_internal(int mip, /* Copy data from Shared Memory into ptr. */ memcpy(r_data, destination_buffer_host_ptr, total_bytes); - MTL_LOG_INFO("gpu::MTLTexture::read_internal success! %lu bytes read", total_bytes); + MTL_LOG_DEBUG("gpu::MTLTexture::read_internal success! %lu bytes read", total_bytes); } else { MTL_LOG_WARNING( @@ -2496,7 +2496,7 @@ void gpu::MTLTexture::ensure_baked() void gpu::MTLTexture::reset() { - MTL_LOG_INFO("Texture %s reset. Size %d, %d, %d", this->get_name(), w_, h_, d_); + MTL_LOG_DEBUG("Texture %s reset. Size %d, %d, %d", this->get_name(), w_, h_, d_); /* Delete associated METAL resources. */ if (texture_ != nil) { [texture_ release]; diff --git a/source/blender/gpu/metal/mtl_vertex_buffer.mm b/source/blender/gpu/metal/mtl_vertex_buffer.mm index 876511a6f10..fbacf34efb3 100644 --- a/source/blender/gpu/metal/mtl_vertex_buffer.mm +++ b/source/blender/gpu/metal/mtl_vertex_buffer.mm @@ -72,7 +72,7 @@ void MTLVertBuf::bind() uint64_t required_size = max_ulul(required_size_raw, 128); if (required_size_raw == 0) { - MTL_LOG_INFO("Vertex buffer required_size = 0"); + MTL_LOG_DEBUG("Vertex buffer required_size = 0"); } /* If the vertex buffer has already been allocated, but new data is ready, diff --git a/source/blender/gpu/opengl/gl_debug.cc b/source/blender/gpu/opengl/gl_debug.cc index 4d1dac7b32a..b9ce076c42f 100644 --- a/source/blender/gpu/opengl/gl_debug.cc +++ b/source/blender/gpu/opengl/gl_debug.cc @@ -82,15 +82,15 @@ static void APIENTRY debug_callback(GLenum /*source*/, const bool use_color = CLG_color_support_get(&LOG); if (ELEM(severity, GL_DEBUG_SEVERITY_LOW, GL_DEBUG_SEVERITY_NOTIFICATION)) { - if ((LOG.type->flag & CLG_FLAG_USE) && (LOG.type->level >= CLG_SEVERITY_INFO)) { + if (CLOG_CHECK(&LOG, CLG_LEVEL_INFO)) { const char *format = use_color ? "\033[2m%s\033[0m" : "%s"; - CLG_logf(LOG.type, CLG_SEVERITY_INFO, "Notification", "", format, message); + CLG_logf(LOG.type, CLG_LEVEL_INFO, "Notification", "", format, message); } } else { char debug_groups[512] = ""; GPU_debug_get_groups_names(sizeof(debug_groups), debug_groups); - CLG_Severity clog_severity; + CLG_Level clog_level; if (GPU_debug_group_match(GPU_DEBUG_SHADER_COMPILATION_GROUP) || GPU_debug_group_match(GPU_DEBUG_SHADER_SPECIALIZATION_GROUP)) @@ -103,19 +103,19 @@ static void APIENTRY debug_callback(GLenum /*source*/, case GL_DEBUG_TYPE_ERROR: case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: - clog_severity = CLG_SEVERITY_ERROR; + clog_level = CLG_LEVEL_ERROR; break; case GL_DEBUG_TYPE_PORTABILITY: case GL_DEBUG_TYPE_PERFORMANCE: case GL_DEBUG_TYPE_OTHER: case GL_DEBUG_TYPE_MARKER: /* KHR has this, ARB does not */ default: - clog_severity = CLG_SEVERITY_WARN; + clog_level = CLG_LEVEL_WARN; break; } - if ((LOG.type->flag & CLG_FLAG_USE) && (LOG.type->level <= clog_severity)) { - CLG_logf(LOG.type, clog_severity, debug_groups, "", "%s", message); + if (CLOG_CHECK(&LOG, clog_level)) { + CLG_logf(LOG.type, clog_level, debug_groups, "", "%s", message); if (severity == GL_DEBUG_SEVERITY_HIGH) { /* Focus on error message. */ if (use_color) { diff --git a/source/blender/gpu/vulkan/vk_backend.cc b/source/blender/gpu/vulkan/vk_backend.cc index d195b86d6e6..5b8570a045f 100644 --- a/source/blender/gpu/vulkan/vk_backend.cc +++ b/source/blender/gpu/vulkan/vk_backend.cc @@ -248,11 +248,11 @@ bool VKBackend::is_supported() /* Report result. */ if (missing_capabilities.is_empty()) { /* This device meets minimum requirements. */ - CLOG_INFO(&LOG, - 2, - "Device [%s] supports minimum requirements. Skip checking other GPUs. Another GPU " - "can still be selected during auto-detection.", - vk_properties.deviceName); + CLOG_DEBUG( + &LOG, + "Device [%s] supports minimum requirements. Skip checking other GPUs. Another GPU " + "can still be selected during auto-detection.", + vk_properties.deviceName); vkDestroyInstance(vk_instance, nullptr); return true; @@ -380,7 +380,6 @@ void VKBackend::platform_init(const VKDevice &device) } CLOG_INFO(&LOG, - 0, "Using vendor [%s] device [%s] driver version [%s].", vendor_name.c_str(), device.vk_physical_device_properties_.deviceName, diff --git a/source/blender/gpu/vulkan/vk_debug.cc b/source/blender/gpu/vulkan/vk_debug.cc index 9911d06ff53..0df49d2366b 100644 --- a/source/blender/gpu/vulkan/vk_debug.cc +++ b/source/blender/gpu/vulkan/vk_debug.cc @@ -219,30 +219,29 @@ messenger_callback(VkDebugUtilsMessageSeverityFlagBitsEXT message_severity, const VkDebugUtilsMessengerCallbackDataEXT *callback_data, void *user_data) { - CLG_Severity severity = CLG_SEVERITY_INFO; + CLG_Level level = CLG_LEVEL_INFO; if (message_severity & (VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT)) { - severity = CLG_SEVERITY_INFO; + level = CLG_LEVEL_INFO; } if (message_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) { - severity = CLG_SEVERITY_WARN; + level = CLG_LEVEL_WARN; } if (message_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) { - severity = CLG_SEVERITY_ERROR; + level = CLG_LEVEL_ERROR; } const char *format = "{0x%x}% s\n %s "; - CLOG_AT_SEVERITY(&LOG, - severity, - 0, - format, - callback_data->messageIdNumber, - callback_data->pMessageIdName, - callback_data->pMessage); + CLOG_AT_LEVEL(&LOG, + level, + format, + callback_data->messageIdNumber, + callback_data->pMessageIdName, + callback_data->pMessage); const bool do_labels = (callback_data->objectCount + callback_data->cmdBufLabelCount + callback_data->queueLabelCount) > 0; - const bool log_active = bool(LOG.type->flag & CLG_FLAG_USE) || severity >= CLG_SEVERITY_WARN; + const bool log_active = CLOG_CHECK(&LOG, CLG_LEVEL_INFO) || level >= CLG_LEVEL_WARN; if (do_labels && log_active) { VKDebuggingTools &debugging_tools = *reinterpret_cast(user_data); debugging_tools.print_labels(callback_data); diff --git a/source/blender/gpu/vulkan/vk_device.cc b/source/blender/gpu/vulkan/vk_device.cc index c347ca2f8ca..7476e53e11a 100644 --- a/source/blender/gpu/vulkan/vk_device.cc +++ b/source/blender/gpu/vulkan/vk_device.cc @@ -32,28 +32,27 @@ namespace blender::gpu { void VKExtensions::log() const { - CLOG_INFO(&LOG, - 2, - "Device features\n" - " - [%c] shader output viewport index\n" - " - [%c] shader output layer\n" - " - [%c] fragment shader barycentric\n" - "Device extensions\n" - " - [%c] descriptor buffer\n" - " - [%c] dynamic rendering\n" - " - [%c] dynamic rendering local read\n" - " - [%c] dynamic rendering unused attachments\n" - " - [%c] external memory\n" - " - [%c] shader stencil export", - shader_output_viewport_index ? 'X' : ' ', - shader_output_layer ? 'X' : ' ', - fragment_shader_barycentric ? 'X' : ' ', - descriptor_buffer ? 'X' : ' ', - dynamic_rendering ? 'X' : ' ', - dynamic_rendering_local_read ? 'X' : ' ', - dynamic_rendering_unused_attachments ? 'X' : ' ', - external_memory ? 'X' : ' ', - GPU_stencil_export_support() ? 'X' : ' '); + CLOG_DEBUG(&LOG, + "Device features\n" + " - [%c] shader output viewport index\n" + " - [%c] shader output layer\n" + " - [%c] fragment shader barycentric\n" + "Device extensions\n" + " - [%c] descriptor buffer\n" + " - [%c] dynamic rendering\n" + " - [%c] dynamic rendering local read\n" + " - [%c] dynamic rendering unused attachments\n" + " - [%c] external memory\n" + " - [%c] shader stencil export", + shader_output_viewport_index ? 'X' : ' ', + shader_output_layer ? 'X' : ' ', + fragment_shader_barycentric ? 'X' : ' ', + descriptor_buffer ? 'X' : ' ', + dynamic_rendering ? 'X' : ' ', + dynamic_rendering_local_read ? 'X' : ' ', + dynamic_rendering_unused_attachments ? 'X' : ' ', + external_memory ? 'X' : ' ', + GPU_stencil_export_support() ? 'X' : ' '); } void VKDevice::reinit() diff --git a/source/blender/gpu/vulkan/vk_device_submission.cc b/source/blender/gpu/vulkan/vk_device_submission.cc index faa950ac6e3..2ffff8918a5 100644 --- a/source/blender/gpu/vulkan/vk_device_submission.cc +++ b/source/blender/gpu/vulkan/vk_device_submission.cc @@ -128,7 +128,7 @@ render_graph::VKRenderGraph *VKDevice::render_graph_new() void VKDevice::submission_runner(TaskPool *__restrict pool, void *task_data) { - CLOG_INFO(&LOG, 3, "submission runner has started"); + CLOG_TRACE(&LOG, "Submission runner has started"); UNUSED_VARS(task_data); VKDevice *device = static_cast(BLI_task_pool_user_data(pool)); @@ -150,7 +150,7 @@ void VKDevice::submission_runner(TaskPool *__restrict pool, void *task_data) submit_infos.reserve(2); std::optional command_buffer; - CLOG_INFO(&LOG, 3, "submission runner initialized"); + CLOG_TRACE(&LOG, "Submission runner initialized"); while (!BLI_task_pool_current_canceled(pool)) { VKRenderGraphSubmitTask *submit_task = static_cast( BLI_thread_queue_pop_timeout(device->submitted_render_graphs_, 1)); @@ -277,7 +277,7 @@ void VKDevice::submission_runner(TaskPool *__restrict pool, void *task_data) BLI_THREAD_QUEUE_WORK_PRIORITY_NORMAL); MEM_delete(submit_task); } - CLOG_INFO(&LOG, 3, "submission runner is being canceled"); + CLOG_TRACE(&LOG, "Submission runner is being canceled"); /* Clear command buffers and pool */ vkDeviceWaitIdle(device->vk_device_); @@ -289,12 +289,12 @@ void VKDevice::submission_runner(TaskPool *__restrict pool, void *task_data) command_buffers_unused.size(), command_buffers_unused.data()); vkDestroyCommandPool(device->vk_device_, vk_command_pool, nullptr); - CLOG_INFO(&LOG, 3, "submission runner finished"); + CLOG_TRACE(&LOG, "Submission runner finished"); } void VKDevice::init_submission_pool() { - CLOG_INFO(&LOG, 3, "create submission pool"); + CLOG_TRACE(&LOG, "Create submission pool"); submission_pool_ = BLI_task_pool_create_background_serial(this, TASK_PRIORITY_HIGH); BLI_task_pool_push(submission_pool_, VKDevice::submission_runner, nullptr, false, nullptr); submitted_render_graphs_ = BLI_thread_queue_init(); @@ -309,11 +309,11 @@ void VKDevice::init_submission_pool() void VKDevice::deinit_submission_pool() { - CLOG_INFO(&LOG, 3, "cancelling submission pool"); + CLOG_TRACE(&LOG, "Cancelling submission pool"); BLI_task_pool_cancel(submission_pool_); - CLOG_INFO(&LOG, 3, "waiting for completion"); + CLOG_TRACE(&LOG, "Waiting for completion"); BLI_task_pool_work_and_wait(submission_pool_); - CLOG_INFO(&LOG, 3, "freeing submission pool"); + CLOG_TRACE(&LOG, "Freeing submission pool"); BLI_task_pool_free(submission_pool_); submission_pool_ = nullptr; diff --git a/source/blender/gpu/vulkan/vk_immediate.cc b/source/blender/gpu/vulkan/vk_immediate.cc index 53023328312..349e0097d8a 100644 --- a/source/blender/gpu/vulkan/vk_immediate.cc +++ b/source/blender/gpu/vulkan/vk_immediate.cc @@ -156,7 +156,7 @@ VKBuffer &VKImmediate::ensure_space(VkDeviceSize bytes_needed, VkDeviceSize offs if (!recycling_buffers_.is_empty() && recycling_buffers_.last()->size_in_bytes() >= bytes_required) { - CLOG_INFO(&LOG, 3, "Activating recycled buffer"); + CLOG_DEBUG(&LOG, "Activating recycled buffer"); buffer_offset_ = 0; active_buffers_.append(recycling_buffers_.pop_last()); return *active_buffers_.last(); @@ -164,7 +164,7 @@ VKBuffer &VKImmediate::ensure_space(VkDeviceSize bytes_needed, VkDeviceSize offs /* Offset alignment isn't needed when creating buffers as it is managed by VMA. */ VkDeviceSize alloc_size = new_buffer_size(bytes_needed); - CLOG_INFO(&LOG, 3, "Allocate buffer (size=%d)", int(alloc_size)); + CLOG_DEBUG(&LOG, "Allocate buffer (size=%d)", int(alloc_size)); buffer_offset_ = 0; active_buffers_.append(std::make_unique()); VKBuffer &result = *active_buffers_.last(); @@ -183,7 +183,7 @@ VKBuffer &VKImmediate::ensure_space(VkDeviceSize bytes_needed, VkDeviceSize offs void VKImmediate::reset() { if (!recycling_buffers_.is_empty()) { - CLOG_INFO(&LOG, 3, "Discarding %d unused buffers", int(recycling_buffers_.size())); + CLOG_DEBUG(&LOG, "Discarding %d unused buffers", int(recycling_buffers_.size())); } recycling_buffers_.clear(); recycling_buffers_ = std::move(active_buffers_); diff --git a/source/blender/gpu/vulkan/vk_pipeline_pool.cc b/source/blender/gpu/vulkan/vk_pipeline_pool.cc index 961273ac304..fea8643d0b9 100644 --- a/source/blender/gpu/vulkan/vk_pipeline_pool.cc +++ b/source/blender/gpu/vulkan/vk_pipeline_pool.cc @@ -768,14 +768,13 @@ void VKPipelinePool::read_from_disk() */ MEM_freeN(buffer); CLOG_INFO(&LOG, - 1, "Pipeline cache on disk [%s] is ignored as it was written by a different driver or " "Blender version. Cache will be overwritten when exiting.", cache_file.c_str()); return; } - CLOG_INFO(&LOG, 1, "Initialize static pipeline cache from disk [%s].", cache_file.c_str()); + CLOG_INFO(&LOG, "Initialize static pipeline cache from disk [%s].", cache_file.c_str()); VKDevice &device = VKBackend::get().device; VkPipelineCacheCreateInfo create_info = {}; create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO; @@ -806,7 +805,7 @@ void VKPipelinePool::write_to_disk() vkGetPipelineCacheData(device.vk_handle(), vk_pipeline_cache_static_, &data_size, buffer); std::string cache_file = pipeline_cache_filepath_get(); - CLOG_INFO(&LOG, 1, "Writing static pipeline cache to disk [%s].", cache_file.c_str()); + CLOG_INFO(&LOG, "Writing static pipeline cache to disk [%s].", cache_file.c_str()); fstream file(cache_file, std::ios::binary | std::ios::out); diff --git a/source/blender/io/alembic/exporter/abc_export_capi.cc b/source/blender/io/alembic/exporter/abc_export_capi.cc index da8827a933a..395825d60a9 100644 --- a/source/blender/io/alembic/exporter/abc_export_capi.cc +++ b/source/blender/io/alembic/exporter/abc_export_capi.cc @@ -137,7 +137,7 @@ static void export_startjob(void *customdata, wmJobWorkerStatus *worker_status) ABCHierarchyIterator iter(data->bmain, data->depsgraph, abc_archive.get(), data->params); if (export_animation) { - CLOG_INFO(&LOG, 2, "Exporting animation"); + CLOG_STR_DEBUG(&LOG, "Exporting animation"); /* Writing the animated frames is not 100% of the work, but it's our best guess. */ const float progress_per_frame = 1.0f / std::max(size_t(1), abc_archive->total_frame_count()); @@ -156,7 +156,7 @@ static void export_startjob(void *customdata, wmJobWorkerStatus *worker_status) scene->r.subframe = float(frame - scene->r.cfra); BKE_scene_graph_update_for_newframe(data->depsgraph); - CLOG_INFO(&LOG, 2, "Exporting frame %.2f", frame); + CLOG_DEBUG(&LOG, "Exporting frame %.2f", frame); ExportSubset export_subset = abc_archive->export_subset_for_frame(frame); iter.set_export_subset(export_subset); iter.iterate_and_write(); diff --git a/source/blender/io/alembic/exporter/abc_writer_camera.cc b/source/blender/io/alembic/exporter/abc_writer_camera.cc index 097f65b1148..e5478f5a1f1 100644 --- a/source/blender/io/alembic/exporter/abc_writer_camera.cc +++ b/source/blender/io/alembic/exporter/abc_writer_camera.cc @@ -35,7 +35,7 @@ bool ABCCameraWriter::is_supported(const HierarchyContext *context) const void ABCCameraWriter::create_alembic_objects(const HierarchyContext * /*context*/) { - CLOG_INFO(&LOG, 2, "exporting %s", args_.abc_path.c_str()); + CLOG_DEBUG(&LOG, "exporting %s", args_.abc_path.c_str()); abc_camera_ = OCamera(args_.abc_parent, args_.abc_name, timesample_index_); abc_camera_schema_ = abc_camera_.getSchema(); diff --git a/source/blender/io/alembic/exporter/abc_writer_curves.cc b/source/blender/io/alembic/exporter/abc_writer_curves.cc index 7780be54b33..f7feaa112b1 100644 --- a/source/blender/io/alembic/exporter/abc_writer_curves.cc +++ b/source/blender/io/alembic/exporter/abc_writer_curves.cc @@ -50,7 +50,7 @@ ABCCurveWriter::ABCCurveWriter(const ABCWriterConstructorArgs &args) : ABCAbstra void ABCCurveWriter::create_alembic_objects(const HierarchyContext *context) { - CLOG_INFO(&LOG, 2, "exporting %s", args_.abc_path.c_str()); + CLOG_DEBUG(&LOG, "exporting %s", args_.abc_path.c_str()); abc_curve_ = OCurves(args_.abc_parent, args_.abc_name, timesample_index_); abc_curve_schema_ = abc_curve_.getSchema(); diff --git a/source/blender/io/alembic/exporter/abc_writer_hair.cc b/source/blender/io/alembic/exporter/abc_writer_hair.cc index 79ed02b9d49..3c4d61a0347 100644 --- a/source/blender/io/alembic/exporter/abc_writer_hair.cc +++ b/source/blender/io/alembic/exporter/abc_writer_hair.cc @@ -40,7 +40,7 @@ ABCHairWriter::ABCHairWriter(const ABCWriterConstructorArgs &args) void ABCHairWriter::create_alembic_objects(const HierarchyContext * /*context*/) { - CLOG_INFO(&LOG, 2, "exporting %s", args_.abc_path.c_str()); + CLOG_DEBUG(&LOG, "exporting %s", args_.abc_path.c_str()); abc_curves_ = OCurves(args_.abc_parent, args_.abc_name, timesample_index_); abc_curves_schema_ = abc_curves_.getSchema(); } diff --git a/source/blender/io/alembic/exporter/abc_writer_instance.cc b/source/blender/io/alembic/exporter/abc_writer_instance.cc index f06de972328..17cfbfbccd0 100644 --- a/source/blender/io/alembic/exporter/abc_writer_instance.cc +++ b/source/blender/io/alembic/exporter/abc_writer_instance.cc @@ -31,7 +31,7 @@ void ABCInstanceWriter::create_alembic_objects(const HierarchyContext *context) CLOG_WARN(&LOG, "unable to export %s as instance", args_.abc_path.c_str()); return; } - CLOG_INFO(&LOG, 2, "exporting instance %s", args_.abc_path.c_str()); + CLOG_DEBUG(&LOG, "exporting instance %s", args_.abc_path.c_str()); } void ABCInstanceWriter::ensure_custom_properties_exporter(const HierarchyContext & /*context*/) diff --git a/source/blender/io/alembic/exporter/abc_writer_mesh.cc b/source/blender/io/alembic/exporter/abc_writer_mesh.cc index 14b114fc6af..8b90f9dbd67 100644 --- a/source/blender/io/alembic/exporter/abc_writer_mesh.cc +++ b/source/blender/io/alembic/exporter/abc_writer_mesh.cc @@ -78,12 +78,12 @@ void ABCGenericMeshWriter::create_alembic_objects(const HierarchyContext *contex } if (is_subd_) { - CLOG_INFO(&LOG, 2, "exporting OSubD %s", args_.abc_path.c_str()); + CLOG_DEBUG(&LOG, "exporting OSubD %s", args_.abc_path.c_str()); abc_subdiv_ = OSubD(args_.abc_parent, args_.abc_name, timesample_index_); abc_subdiv_schema_ = abc_subdiv_.getSchema(); } else { - CLOG_INFO(&LOG, 2, "exporting OPolyMesh %s", args_.abc_path.c_str()); + CLOG_DEBUG(&LOG, "exporting OPolyMesh %s", args_.abc_path.c_str()); abc_poly_mesh_ = OPolyMesh(args_.abc_parent, args_.abc_name, timesample_index_); abc_poly_mesh_schema_ = abc_poly_mesh_.getSchema(); diff --git a/source/blender/io/alembic/exporter/abc_writer_nurbs.cc b/source/blender/io/alembic/exporter/abc_writer_nurbs.cc index dba8f1a415d..e2307f1181f 100644 --- a/source/blender/io/alembic/exporter/abc_writer_nurbs.cc +++ b/source/blender/io/alembic/exporter/abc_writer_nurbs.cc @@ -47,7 +47,7 @@ void ABCNurbsWriter::create_alembic_objects(const HierarchyContext *context) } std::string patch_name = patch_name_stream.str(); - CLOG_INFO(&LOG, 2, "exporting %s/%s", abc_parent_path, patch_name.c_str()); + CLOG_DEBUG(&LOG, "exporting %s/%s", abc_parent_path, patch_name.c_str()); ONuPatch nurbs(abc_parent, patch_name, timesample_index_); abc_nurbs_.push_back(nurbs); diff --git a/source/blender/io/alembic/exporter/abc_writer_points.cc b/source/blender/io/alembic/exporter/abc_writer_points.cc index 8e8224ec5ea..c95ce85058f 100644 --- a/source/blender/io/alembic/exporter/abc_writer_points.cc +++ b/source/blender/io/alembic/exporter/abc_writer_points.cc @@ -31,7 +31,7 @@ ABCPointsWriter::ABCPointsWriter(const ABCWriterConstructorArgs &args) : ABCAbst void ABCPointsWriter::create_alembic_objects(const HierarchyContext * /*context*/) { - CLOG_INFO(&LOG, 2, "exporting OPoints %s", args_.abc_path.c_str()); + CLOG_DEBUG(&LOG, "exporting OPoints %s", args_.abc_path.c_str()); abc_points_ = OPoints(args_.abc_parent, args_.abc_name, timesample_index_); abc_points_schema_ = abc_points_.getSchema(); } diff --git a/source/blender/io/alembic/exporter/abc_writer_transform.cc b/source/blender/io/alembic/exporter/abc_writer_transform.cc index e73837d64c0..3b66654a67f 100644 --- a/source/blender/io/alembic/exporter/abc_writer_transform.cc +++ b/source/blender/io/alembic/exporter/abc_writer_transform.cc @@ -36,7 +36,7 @@ ABCTransformWriter::ABCTransformWriter(const ABCWriterConstructorArgs &args) void ABCTransformWriter::create_alembic_objects(const HierarchyContext * /*context*/) { - CLOG_INFO(&LOG, 2, "exporting %s", args_.abc_path.c_str()); + CLOG_DEBUG(&LOG, "exporting %s", args_.abc_path.c_str()); abc_xform_ = OXform(args_.abc_parent, args_.abc_name, timesample_index_); abc_xform_schema_ = abc_xform_.getSchema(); } diff --git a/source/blender/io/usd/hydra/curves.cc b/source/blender/io/usd/hydra/curves.cc index 7539a2c3557..4cca50db45f 100644 --- a/source/blender/io/usd/hydra/curves.cc +++ b/source/blender/io/usd/hydra/curves.cc @@ -36,7 +36,7 @@ CurvesData::CurvesData(HydraSceneDelegate *scene_delegate, void CurvesData::init() { - ID_LOGN(1, ""); + ID_LOGN(""); write_curves(); write_transform(); @@ -45,14 +45,14 @@ void CurvesData::init() void CurvesData::insert() { - ID_LOGN(1, ""); + ID_LOGN(""); scene_delegate_->GetRenderIndex().InsertRprim( pxr::HdPrimTypeTokens->basisCurves, scene_delegate_, prim_id); } void CurvesData::remove() { - ID_LOG(1, ""); + ID_LOG(""); scene_delegate_->GetRenderIndex().RemoveRprim(prim_id); } @@ -78,7 +78,7 @@ void CurvesData::update() } scene_delegate_->GetRenderIndex().GetChangeTracker().MarkRprimDirty(prim_id, bits); - ID_LOGN(1, ""); + ID_LOGN(""); } pxr::VtValue CurvesData::get_data(pxr::TfToken const &key) const @@ -211,7 +211,7 @@ void HairData::update() scene_delegate_->GetRenderIndex().GetChangeTracker().MarkRprimDirty( prim_id, pxr::HdChangeTracker::AllDirty); - ID_LOGN(1, ""); + ID_LOGN(""); } void HairData::write_transform() diff --git a/source/blender/io/usd/hydra/hydra_scene_delegate.cc b/source/blender/io/usd/hydra/hydra_scene_delegate.cc index b080d3f2c68..8d99822c35b 100644 --- a/source/blender/io/usd/hydra/hydra_scene_delegate.cc +++ b/source/blender/io/usd/hydra/hydra_scene_delegate.cc @@ -45,21 +45,21 @@ HydraSceneDelegate::HydraSceneDelegate(pxr::HdRenderIndex *parent_index, pxr::HdMeshTopology HydraSceneDelegate::GetMeshTopology(pxr::SdfPath const &id) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s", id.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s", id.GetText()); MeshData *m_data = mesh_data(id); return m_data->topology(id); } pxr::HdBasisCurvesTopology HydraSceneDelegate::GetBasisCurvesTopology(pxr::SdfPath const &id) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s", id.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s", id.GetText()); CurvesData *c_data = curves_data(id); return c_data->topology(); }; pxr::GfMatrix4d HydraSceneDelegate::GetTransform(pxr::SdfPath const &id) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s", id.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s", id.GetText()); InstancerData *i_data = instancer_data(id, true); if (i_data) { return i_data->transform(id); @@ -73,7 +73,7 @@ pxr::GfMatrix4d HydraSceneDelegate::GetTransform(pxr::SdfPath const &id) pxr::VtValue HydraSceneDelegate::Get(pxr::SdfPath const &id, pxr::TfToken const &key) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s, %s", id.GetText(), key.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s, %s", id.GetText(), key.GetText()); ObjectData *obj_data = object_data(id); if (obj_data) { return obj_data->get_data(id, key); @@ -92,7 +92,7 @@ pxr::VtValue HydraSceneDelegate::Get(pxr::SdfPath const &id, pxr::TfToken const pxr::VtValue HydraSceneDelegate::GetLightParamValue(pxr::SdfPath const &id, pxr::TfToken const &key) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s, %s", id.GetText(), key.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s, %s", id.GetText(), key.GetText()); LightData *l_data = light_data(id); if (l_data) { return l_data->get_data(key); @@ -103,7 +103,7 @@ pxr::VtValue HydraSceneDelegate::GetLightParamValue(pxr::SdfPath const &id, pxr::HdPrimvarDescriptorVector HydraSceneDelegate::GetPrimvarDescriptors( pxr::SdfPath const &id, pxr::HdInterpolation interpolation) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s, %d", id.GetText(), interpolation); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s, %d", id.GetText(), interpolation); MeshData *m_data = mesh_data(id); if (m_data) { return m_data->primvar_descriptors(interpolation); @@ -121,7 +121,7 @@ pxr::HdPrimvarDescriptorVector HydraSceneDelegate::GetPrimvarDescriptors( pxr::SdfPath HydraSceneDelegate::GetMaterialId(pxr::SdfPath const &rprim_id) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s", rprim_id.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s", rprim_id.GetText()); ObjectData *obj_data = object_data(rprim_id); if (obj_data) { return obj_data->material_id(rprim_id); @@ -131,7 +131,7 @@ pxr::SdfPath HydraSceneDelegate::GetMaterialId(pxr::SdfPath const &rprim_id) pxr::VtValue HydraSceneDelegate::GetMaterialResource(pxr::SdfPath const &id) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s", id.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s", id.GetText()); MaterialData *mat_data = material_data(id); if (mat_data) { return mat_data->get_material_resource(); @@ -141,7 +141,7 @@ pxr::VtValue HydraSceneDelegate::GetMaterialResource(pxr::SdfPath const &id) bool HydraSceneDelegate::GetVisible(pxr::SdfPath const &id) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s", id.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s", id.GetText()); if (id == world_prim_id()) { return true; } @@ -154,19 +154,19 @@ bool HydraSceneDelegate::GetVisible(pxr::SdfPath const &id) bool HydraSceneDelegate::GetDoubleSided(pxr::SdfPath const &id) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s", id.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s", id.GetText()); return mesh_data(id)->double_sided(id); } pxr::HdCullStyle HydraSceneDelegate::GetCullStyle(pxr::SdfPath const &id) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s", id.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s", id.GetText()); return mesh_data(id)->cull_style(id); } pxr::SdfPath HydraSceneDelegate::GetInstancerId(pxr::SdfPath const &prim_id) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s", prim_id.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s", prim_id.GetText()); InstancerData *i_data = instancer_data(prim_id, true); if (i_data && mesh_data(prim_id)) { return i_data->prim_id; @@ -176,7 +176,7 @@ pxr::SdfPath HydraSceneDelegate::GetInstancerId(pxr::SdfPath const &prim_id) pxr::SdfPathVector HydraSceneDelegate::GetInstancerPrototypes(pxr::SdfPath const &instancer_id) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s", instancer_id.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s", instancer_id.GetText()); InstancerData *i_data = instancer_data(instancer_id); return i_data->prototypes(); } @@ -184,14 +184,14 @@ pxr::SdfPathVector HydraSceneDelegate::GetInstancerPrototypes(pxr::SdfPath const pxr::VtIntArray HydraSceneDelegate::GetInstanceIndices(pxr::SdfPath const &instancer_id, pxr::SdfPath const &prototype_id) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s, %s", instancer_id.GetText(), prototype_id.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s, %s", instancer_id.GetText(), prototype_id.GetText()); InstancerData *i_data = instancer_data(instancer_id); return i_data->indices(prototype_id); } pxr::GfMatrix4d HydraSceneDelegate::GetInstancerTransform(pxr::SdfPath const &instancer_id) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s", instancer_id.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s", instancer_id.GetText()); InstancerData *i_data = instancer_data(instancer_id); return i_data->transform(instancer_id); } @@ -199,7 +199,7 @@ pxr::GfMatrix4d HydraSceneDelegate::GetInstancerTransform(pxr::SdfPath const &in pxr::HdVolumeFieldDescriptorVector HydraSceneDelegate::GetVolumeFieldDescriptors( pxr::SdfPath const &volume_id) { - CLOG_INFO(LOG_HYDRA_SCENE, 3, "%s", volume_id.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s", volume_id.GetText()); VolumeData *v_data = volume_data(volume_id); return v_data->field_descriptors(); } @@ -377,7 +377,6 @@ void HydraSceneDelegate::check_updates() ITER_BEGIN (DEG_iterator_ids_begin, DEG_iterator_ids_next, DEG_iterator_ids_end, &data, ID *, id) { CLOG_INFO(LOG_HYDRA_SCENE, - 0, "Update: %s [%s]", id->name, std::bitset<32>(id->recalc).to_string().c_str()); diff --git a/source/blender/io/usd/hydra/id.hh b/source/blender/io/usd/hydra/id.hh index d93f88abe62..5722f7b05c3 100644 --- a/source/blender/io/usd/hydra/id.hh +++ b/source/blender/io/usd/hydra/id.hh @@ -50,15 +50,10 @@ class IdData { virtual pxr::VtValue get_data(pxr::TfToken const &key) const = 0; }; -#define ID_LOG(level, msg, ...) \ - CLOG_INFO(LOG_HYDRA_SCENE, level, "%s: " msg, prim_id.GetText(), ##__VA_ARGS__); +#define ID_LOG(msg, ...) CLOG_DEBUG(LOG_HYDRA_SCENE, "%s: " msg, prim_id.GetText(), ##__VA_ARGS__); -#define ID_LOGN(level, msg, ...) \ - CLOG_INFO(LOG_HYDRA_SCENE, \ - level, \ - "%s (%s): " msg, \ - prim_id.GetText(), \ - id ? id->name : "", \ - ##__VA_ARGS__); +#define ID_LOGN(msg, ...) \ + CLOG_DEBUG( \ + LOG_HYDRA_SCENE, "%s (%s): " msg, prim_id.GetText(), id ? id->name : "", ##__VA_ARGS__); } // namespace blender::io::hydra diff --git a/source/blender/io/usd/hydra/image.cc b/source/blender/io/usd/hydra/image.cc index 30d08546397..2a07284faa4 100644 --- a/source/blender/io/usd/hydra/image.cc +++ b/source/blender/io/usd/hydra/image.cc @@ -48,7 +48,7 @@ static std::string cache_image_file( opts.save_copy = true; STRNCPY(opts.filepath, file_path.c_str()); if (BKE_image_save(nullptr, bmain, image, iuser, &opts)) { - CLOG_INFO(LOG_HYDRA_SCENE, 1, "%s -> %s", image->id.name, file_path.c_str()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s -> %s", image->id.name, file_path.c_str()); } else { CLOG_ERROR(LOG_HYDRA_SCENE, "Can't save %s", file_path.c_str()); @@ -104,7 +104,7 @@ std::string cache_or_get_image_file(Main *bmain, Scene *scene, Image *image, Ima file_path = cache_image_file(bmain, scene, image, iuser, true); } - CLOG_INFO(LOG_HYDRA_SCENE, 1, "%s -> %s", image->id.name, file_path.c_str()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "%s -> %s", image->id.name, file_path.c_str()); return file_path; } diff --git a/source/blender/io/usd/hydra/instancer.cc b/source/blender/io/usd/hydra/instancer.cc index 43bf30537d7..22c75d87974 100644 --- a/source/blender/io/usd/hydra/instancer.cc +++ b/source/blender/io/usd/hydra/instancer.cc @@ -32,7 +32,7 @@ void InstancerData::insert() {} void InstancerData::remove() { - CLOG_INFO(LOG_HYDRA_SCENE, 1, "%s", prim_id.GetText()); + CLOG_DEBUG(LOG_HYDRA_SCENE, "Remove instancer prim \"%s\"", prim_id.GetText()); for (auto &m_inst : mesh_instances_.values()) { m_inst.data->remove(); } @@ -52,7 +52,7 @@ void InstancerData::update() {} pxr::VtValue InstancerData::get_data(pxr::TfToken const &key) const { - ID_LOG(3, "%s", key.GetText()); + ID_LOG("%s", key.GetText()); if (key == pxr::HdInstancerTokens->instanceTransforms) { return pxr::VtValue(mesh_transforms_); } @@ -153,7 +153,7 @@ void InstancerData::update_instance(DupliObject *dupli) else { m_inst->data->update(); } - ID_LOG(2, "Mesh %s %d", m_inst->data->id->name, int(mesh_transforms_.size())); + ID_LOG("Mesh %s %d", m_inst->data->id->name, int(mesh_transforms_.size())); m_inst->indices.push_back(mesh_transforms_.size()); mesh_transforms_.push_back(gf_matrix_from_transform(dupli->mat)); } @@ -163,7 +163,7 @@ void InstancerData::update_instance(DupliObject *dupli) nm_inst = &nonmesh_instances_.lookup_or_add_default(p_id); nm_inst->data = ObjectData::create(scene_delegate_, object, p_id); } - ID_LOG(2, "Nonmesh %s %d", nm_inst->data->id->name, int(nm_inst->transforms.size())); + ID_LOG("Nonmesh %s %d", nm_inst->data->id->name, int(nm_inst->transforms.size())); nm_inst->transforms.push_back(gf_matrix_from_transform(dupli->mat)); } @@ -179,7 +179,7 @@ void InstancerData::update_instance(DupliObject *dupli) nm_inst->data = std::make_unique(scene_delegate_, object, h_id, psys); nm_inst->data->init(); } - ID_LOG(2, "Nonmesh %s %d", nm_inst->data->id->name, int(nm_inst->transforms.size())); + ID_LOG("Nonmesh %s %d", nm_inst->data->id->name, int(nm_inst->transforms.size())); nm_inst->transforms.push_back(gf_matrix_from_transform(psys->imat) * gf_matrix_from_transform(dupli->mat)); } @@ -209,17 +209,17 @@ void InstancerData::post_update() /* Important: removing instancer when nonmesh_instances_ are empty too */ if (index.HasInstancer(prim_id) && nonmesh_instances_.is_empty()) { index.RemoveInstancer(prim_id); - ID_LOG(1, "Remove instancer"); + ID_LOG("Remove instancer"); } } else { if (index.HasInstancer(prim_id)) { index.GetChangeTracker().MarkInstancerDirty(prim_id, pxr::HdChangeTracker::AllDirty); - ID_LOG(1, "Update instancer"); + ID_LOG("Update instancer"); } else { index.InsertInstancer(scene_delegate_, prim_id); - ID_LOG(1, "Insert instancer"); + ID_LOG("Insert instancer"); } } } diff --git a/source/blender/io/usd/hydra/light.cc b/source/blender/io/usd/hydra/light.cc index 769e8890a94..02eded5a8ec 100644 --- a/source/blender/io/usd/hydra/light.cc +++ b/source/blender/io/usd/hydra/light.cc @@ -27,7 +27,7 @@ LightData::LightData(HydraSceneDelegate *scene_delegate, void LightData::init() { - ID_LOGN(1, ""); + ID_LOGN(""); const Light *light = (const Light *)((const Object *)id)->data; data_.clear(); @@ -104,13 +104,13 @@ void LightData::init() void LightData::insert() { - ID_LOGN(1, ""); + ID_LOGN(""); scene_delegate_->GetRenderIndex().InsertSprim(prim_type_, scene_delegate_, prim_id); } void LightData::remove() { - ID_LOG(1, ""); + ID_LOG(""); scene_delegate_->GetRenderIndex().RemoveSprim(prim_type_, prim_id); } @@ -135,13 +135,13 @@ void LightData::update() } if (bits != pxr::HdChangeTracker::Clean) { scene_delegate_->GetRenderIndex().GetChangeTracker().MarkSprimDirty(prim_id, bits); - ID_LOGN(1, ""); + ID_LOGN(""); } } pxr::VtValue LightData::get_data(pxr::TfToken const &key) const { - ID_LOGN(3, "%s", key.GetText()); + ID_LOGN("%s", key.GetText()); auto it = data_.find(key); if (it != data_.end()) { return pxr::VtValue(it->second); diff --git a/source/blender/io/usd/hydra/material.cc b/source/blender/io/usd/hydra/material.cc index f1db8c2e16a..c50d1b21dbe 100644 --- a/source/blender/io/usd/hydra/material.cc +++ b/source/blender/io/usd/hydra/material.cc @@ -45,7 +45,7 @@ MaterialData::MaterialData(HydraSceneDelegate *scene_delegate, void MaterialData::init() { - ID_LOGN(1, ""); + ID_LOGN(""); double_sided = (((Material *)id)->blend_flag & MA_BL_CULL_BACKFACE) == 0; material_network_map_ = pxr::VtValue(); @@ -89,7 +89,7 @@ void MaterialData::init() stage->ExportToString(&str); return str; }; - ID_LOGN(2, "Stage:\n%s", stage_str().c_str()); + ID_LOGN("Stage:\n%s", stage_str().c_str()); if (pxr::UsdPrim materials = stage->GetPrimAtPath(pxr::SdfPath("/MaterialX/Materials"))) { pxr::UsdPrimSiblingRange children = materials.GetChildren(); @@ -127,20 +127,20 @@ void MaterialData::init() void MaterialData::insert() { - ID_LOGN(1, ""); + ID_LOGN(""); scene_delegate_->GetRenderIndex().InsertSprim( pxr::HdPrimTypeTokens->material, scene_delegate_, prim_id); } void MaterialData::remove() { - ID_LOG(1, ""); + ID_LOG(""); scene_delegate_->GetRenderIndex().RemoveSprim(pxr::HdPrimTypeTokens->material, prim_id); } void MaterialData::update() { - ID_LOGN(1, ""); + ID_LOGN(""); bool prev_double_sided = double_sided; init(); scene_delegate_->GetRenderIndex().GetChangeTracker().MarkSprimDirty(prim_id, diff --git a/source/blender/io/usd/hydra/mesh.cc b/source/blender/io/usd/hydra/mesh.cc index 41bf8146e75..dff7f185446 100644 --- a/source/blender/io/usd/hydra/mesh.cc +++ b/source/blender/io/usd/hydra/mesh.cc @@ -33,7 +33,7 @@ MeshData::MeshData(HydraSceneDelegate *scene_delegate, void MeshData::init() { - ID_LOGN(1, ""); + ID_LOGN(""); Object *object = (Object *)id; Mesh *mesh = BKE_object_to_mesh(nullptr, object, false); @@ -48,13 +48,13 @@ void MeshData::init() void MeshData::insert() { - ID_LOGN(1, ""); + ID_LOGN(""); update_prims(); } void MeshData::remove() { - ID_LOG(1, ""); + ID_LOG(""); submeshes_.clear(); update_prims(); } @@ -84,7 +84,7 @@ void MeshData::update() for (int i = 0; i < submeshes_.size(); ++i) { scene_delegate_->GetRenderIndex().GetChangeTracker().MarkRprimDirty(submesh_prim_id(i), bits); - ID_LOGN(1, "%d", i); + ID_LOGN("%d", i); } } @@ -180,7 +180,7 @@ void MeshData::update_double_sided(MaterialData *mat_data) scene_delegate_->GetRenderIndex().GetChangeTracker().MarkRprimDirty( submesh_prim_id(i), pxr::HdChangeTracker::DirtyDoubleSided | pxr::HdChangeTracker::DirtyCullStyle); - ID_LOGN(1, "%d", i); + ID_LOGN("%d", i); } } } @@ -428,16 +428,16 @@ void MeshData::update_prims() pxr::SdfPath p = submesh_prim_id(i); if (i < submeshes_count_) { render_index.GetChangeTracker().MarkRprimDirty(p, pxr::HdChangeTracker::AllDirty); - ID_LOGN(1, "Update %d", i); + ID_LOGN("Update %d", i); } else { render_index.InsertRprim(pxr::HdPrimTypeTokens->mesh, scene_delegate_, p); - ID_LOGN(1, "Insert %d", i); + ID_LOGN("Insert %d", i); } } for (; i < submeshes_count_; ++i) { render_index.RemoveRprim(submesh_prim_id(i)); - ID_LOG(1, "Remove %d", i); + ID_LOG("Remove %d", i); } submeshes_count_ = submeshes_.size(); } diff --git a/source/blender/io/usd/hydra/volume.cc b/source/blender/io/usd/hydra/volume.cc index 141aba5b771..d42cc0b4d9d 100644 --- a/source/blender/io/usd/hydra/volume.cc +++ b/source/blender/io/usd/hydra/volume.cc @@ -35,7 +35,7 @@ void VolumeData::init() return; } filepath_ = BKE_volume_grids_frame_filepath(volume); - ID_LOGN(1, "%s", filepath_.c_str()); + ID_LOGN("%s", filepath_.c_str()); if (volume->runtime->grids) { const int num_grids = BKE_volume_num_grids(volume); @@ -61,22 +61,22 @@ void VolumeData::insert() scene_delegate_->GetRenderIndex().InsertRprim( pxr::HdPrimTypeTokens->volume, scene_delegate_, prim_id); - ID_LOGN(1, ""); + ID_LOGN(""); for (auto &desc : field_descriptors_) { scene_delegate_->GetRenderIndex().InsertBprim( desc.fieldPrimType, scene_delegate_, desc.fieldId); - ID_LOGN(2, "Volume field %s", desc.fieldId.GetText()); + ID_LOGN("Volume field %s", desc.fieldId.GetText()); } } void VolumeData::remove() { for (auto &desc : field_descriptors_) { - ID_LOG(2, "%s", desc.fieldId.GetText()); + ID_LOG("%s", desc.fieldId.GetText()); scene_delegate_->GetRenderIndex().RemoveBprim(desc.fieldPrimType, desc.fieldId); } - ID_LOG(1, ""); + ID_LOG(""); scene_delegate_->GetRenderIndex().RemoveRprim(prim_id); } @@ -102,7 +102,7 @@ void VolumeData::update() } scene_delegate_->GetRenderIndex().GetChangeTracker().MarkRprimDirty(prim_id, bits); - ID_LOGN(1, ""); + ID_LOGN(""); } pxr::VtValue VolumeData::get_data(pxr::TfToken const &key) const diff --git a/source/blender/io/usd/hydra/volume_modifier.cc b/source/blender/io/usd/hydra/volume_modifier.cc index 305f46fbaf9..02b7248c460 100644 --- a/source/blender/io/usd/hydra/volume_modifier.cc +++ b/source/blender/io/usd/hydra/volume_modifier.cc @@ -55,7 +55,7 @@ void VolumeModifierData::init() filepath_ = get_cached_file_path(modifier_->domain->cache_directory, scene_delegate_->scene->r.cfra); - ID_LOG(1, "%s", filepath_.c_str()); + ID_LOG("%s", filepath_.c_str()); static const pxr::TfToken grid_tokens[] = {pxr::TfToken("density", pxr::TfToken::Immortal), pxr::TfToken("flame", pxr::TfToken::Immortal), @@ -97,7 +97,7 @@ void VolumeModifierData::update() } scene_delegate_->GetRenderIndex().GetChangeTracker().MarkRprimDirty(prim_id, bits); - ID_LOG(1, ""); + ID_LOG(""); } void VolumeModifierData::write_transform() diff --git a/source/blender/io/usd/hydra/world.cc b/source/blender/io/usd/hydra/world.cc index 9f737270c2c..3c297042935 100644 --- a/source/blender/io/usd/hydra/world.cc +++ b/source/blender/io/usd/hydra/world.cc @@ -51,7 +51,7 @@ void WorldData::init() if (scene_delegate_->shading_settings.use_scene_world) { const World *world = scene_delegate_->scene->world; pxr::GfVec3f color(1.0f, 1.0f, 1.0f); - ID_LOG(1, "%s", world->id.name); + ID_LOG("%s", world->id.name); if (world->use_nodes) { /* TODO: Create nodes parsing system */ @@ -117,7 +117,7 @@ void WorldData::init() } } else { - ID_LOG(1, "studiolight: %s", scene_delegate_->shading_settings.studiolight_name.c_str()); + ID_LOG("studiolight: %s", scene_delegate_->shading_settings.studiolight_name.c_str()); StudioLight *sl = BKE_studiolight_find( scene_delegate_->shading_settings.studiolight_name.c_str(), @@ -139,7 +139,7 @@ void WorldData::init() void WorldData::update() { - ID_LOG(1, ""); + ID_LOG(""); if (!scene_delegate_->shading_settings.use_scene_world || (scene_delegate_->shading_settings.use_scene_world && scene_delegate_->scene->world)) diff --git a/source/blender/io/usd/intern/usd_capi_export.cc b/source/blender/io/usd/intern/usd_capi_export.cc index fae8b1ff828..a63f91c70dc 100644 --- a/source/blender/io/usd/intern/usd_capi_export.cc +++ b/source/blender/io/usd/intern/usd_capi_export.cc @@ -258,12 +258,11 @@ static void process_usdz_textures(const ExportJobData *data, const char *path) height_adjusted); } else { - CLOG_INFO(&LOG, - 2, - "Downscaled '%s' to %dx%d", - entries[index].path, - width_adjusted, - height_adjusted); + CLOG_DEBUG(&LOG, + "Downscaled '%s' to %dx%d", + entries[index].path, + width_adjusted, + height_adjusted); } } @@ -377,7 +376,7 @@ std::string cache_image_color(const float color[4]) ibuf->ftype = IMB_FTYPE_RADHDR; if (IMB_save_image(ibuf, file_path.c_str(), IB_float_data)) { - CLOG_INFO(&LOG, 1, "%s", file_path.c_str()); + CLOG_INFO(&LOG, "%s", file_path.c_str()); } else { CLOG_ERROR(&LOG, "Can't save %s", file_path.c_str()); diff --git a/source/blender/io/usd/intern/usd_skel_root_utils.cc b/source/blender/io/usd/intern/usd_skel_root_utils.cc index d579e95c138..51aa4d6c0cc 100644 --- a/source/blender/io/usd/intern/usd_skel_root_utils.cc +++ b/source/blender/io/usd/intern/usd_skel_root_utils.cc @@ -103,8 +103,8 @@ void create_skel_roots(pxr::UsdStageRefPtr stage, const USDExportParams ¶ms) if (pxr::UsdGeomXform xf = get_xform_ancestor(prim, skel.GetPrim())) { /* We found a common Xform ancestor, so we set its type to UsdSkelRoot. */ - CLOG_INFO( - &LOG, 2, "Converting Xform prim %s to a SkelRoot", prim.GetPath().GetAsString().c_str()); + CLOG_DEBUG( + &LOG, "Converting Xform prim %s to a SkelRoot", prim.GetPath().GetAsString().c_str()); pxr::UsdSkelRoot::Define(stage, xf.GetPath()); converted_to_usdskel = true; diff --git a/source/blender/io/usd/intern/usd_writer_material.cc b/source/blender/io/usd/intern/usd_writer_material.cc index e23900c47af..87428b92c15 100644 --- a/source/blender/io/usd/intern/usd_writer_material.cc +++ b/source/blender/io/usd/intern/usd_writer_material.cc @@ -822,7 +822,7 @@ static void export_in_memory_imbuf(ImBuf *imbuf, return; } - CLOG_INFO(&LOG, 2, "Exporting in-memory texture to '%s'", export_path); + CLOG_DEBUG(&LOG, "Exporting in-memory texture to '%s'", export_path); if (BKE_imbuf_write_as(imbuf, export_path, &imageFormat, true) == false) { BKE_reportf( @@ -949,7 +949,7 @@ static void export_packed_texture(Image *ima, return; } - CLOG_INFO(&LOG, 2, "Exporting packed texture to '%s'", export_path.c_str()); + CLOG_DEBUG(&LOG, "Exporting packed texture to '%s'", export_path.c_str()); write_to_path(pf->data, pf->size, export_path, reports); } @@ -1312,7 +1312,7 @@ static void copy_tiled_textures(Image *ima, continue; } - CLOG_INFO(&LOG, 2, "Copying texture tile from '%s' to '%s'", src_tile_path, dest_tile_path); + CLOG_DEBUG(&LOG, "Copying texture tile from '%s' to '%s'", src_tile_path, dest_tile_path); /* Copy the file. */ if (BLI_copy(src_tile_path, dest_tile_path) != 0) { @@ -1350,7 +1350,7 @@ static void copy_single_file(const Image *ima, return; } - CLOG_INFO(&LOG, 2, "Copying texture from '%s' to '%s'", source_path, dest_path); + CLOG_DEBUG(&LOG, "Copying texture from '%s' to '%s'", source_path, dest_path); /* Copy the file. */ if (BLI_copy(source_path, dest_path) != 0) { diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc b/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc index b25832a141e..2f19554d545 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc +++ b/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc @@ -147,7 +147,6 @@ static std::string get_image_filepath(const bNode *tex_node) /* Put image in the same directory as the `.MTL` file. */ const char *filename = BLI_path_basename(tex_image->filepath); CLOG_INFO(&LOG, - 1, "Packed image found:'%s'. Unpack and place the image in the same " "directory as the .MTL file.", filename); diff --git a/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc b/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc index e05f16aa3a2..0667336e5c0 100644 --- a/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc +++ b/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc @@ -73,7 +73,7 @@ static Image *load_image_at_path(Main *bmain, const std::string &path, bool rela CLOG_WARN(&LOG, "Cannot load image file: '%s'", path.c_str()); return nullptr; } - CLOG_INFO(&LOG, 1, "Loaded image from: '%s'", path.c_str()); + CLOG_INFO(&LOG, "Loaded image from: '%s'", path.c_str()); if (relative_paths) { BLI_path_rel(image->filepath, BKE_main_blendfile_path(bmain)); BLI_path_normalize(image->filepath); diff --git a/source/blender/makesrna/intern/makesrna.cc b/source/blender/makesrna/intern/makesrna.cc index 67f44b8ac3d..f51f779ff65 100644 --- a/source/blender/makesrna/intern/makesrna.cc +++ b/source/blender/makesrna/intern/makesrna.cc @@ -5848,7 +5848,7 @@ int main(int argc, char **argv) /* Some useful defaults since this runs standalone. */ CLG_output_use_basename_set(true); - CLG_level_set(debugSRNA); + CLG_level_set(debugSRNA ? CLG_LEVEL_DEBUG : CLG_LEVEL_WARN); if (argc < 2) { fprintf(stderr, "Usage: %s outdirectory [public header outdirectory]/\n", argv[0]); diff --git a/source/blender/makesrna/intern/rna_access_compare_override.cc b/source/blender/makesrna/intern/rna_access_compare_override.cc index 951819b0a33..fe415a0eb3d 100644 --- a/source/blender/makesrna/intern/rna_access_compare_override.cc +++ b/source/blender/makesrna/intern/rna_access_compare_override.cc @@ -746,7 +746,7 @@ bool RNA_struct_override_matches(Main *bmain, continue; } - CLOG_INFO(&LOG, 5, "Override Checking %s", rna_path->c_str()); + CLOG_DEBUG(&LOG, "Override Checking %s", rna_path->c_str()); if (ignore_overridden) { IDOverrideLibraryProperty *op = BKE_lib_override_library_property_find(liboverride, @@ -832,21 +832,19 @@ bool RNA_struct_override_matches(Main *bmain, const bool is_restored = rna_property_override_operation_apply(bmain, rnaapply_ctx); if (is_restored) { - CLOG_INFO(&LOG, - 5, - "Restoreed forbidden liboverride `%s` for override data '%s'", - rna_path->c_str(), - ptr_local->owner_id->name); + CLOG_DEBUG(&LOG, + "Restoreed forbidden liboverride `%s` for override data '%s'", + rna_path->c_str(), + ptr_local->owner_id->name); if (r_report_flags) { *r_report_flags |= RNA_OVERRIDE_MATCH_RESULT_RESTORED; } } else { - CLOG_INFO(&LOG, - 2, - "Failed to restore forbidden liboverride `%s` for override data '%s'", - rna_path->c_str(), - ptr_local->owner_id->name); + CLOG_DEBUG(&LOG, + "Failed to restore forbidden liboverride `%s` for override data '%s'", + rna_path->c_str(), + ptr_local->owner_id->name); } } else { @@ -875,9 +873,8 @@ bool RNA_struct_override_matches(Main *bmain, opop_restore->tag |= LIBOVERRIDE_PROP_TAG_NEEDS_RETORE; liboverride->runtime->tag |= LIBOVERRIDE_TAG_NEEDS_RESTORE; - CLOG_INFO( + CLOG_DEBUG( &LOG, - 5, "Tagging for restoration forbidden liboverride `%s` for override data '%s'", rna_path->c_str(), ptr_local->owner_id->name); @@ -1290,25 +1287,23 @@ static void rna_property_override_collection_subitem_lookup( ((opop->subitem_reference_name != nullptr && opop->subitem_reference_name[0] != '\0') || opop->subitem_reference_index != -1)) { - CLOG_INFO(&LOG, - 2, - "Failed to find destination sub-item '%s' (%d) of '%s' in new override data '%s'", - opop->subitem_reference_name != nullptr ? opop->subitem_reference_name : "", - opop->subitem_reference_index, - op->rna_path, - ptr_dst->owner_id->name); + CLOG_DEBUG(&LOG, + "Failed to find destination sub-item '%s' (%d) of '%s' in new override data '%s'", + opop->subitem_reference_name != nullptr ? opop->subitem_reference_name : "", + opop->subitem_reference_index, + op->rna_path, + ptr_dst->owner_id->name); } if (ptr_item_src->type == nullptr && ((opop->subitem_local_name != nullptr && opop->subitem_local_name[0] != '\0') || opop->subitem_local_index != -1)) { - CLOG_INFO(&LOG, - 2, - "Failed to find source sub-item '%s' (%d) of '%s' in old override data '%s'", - opop->subitem_local_name != nullptr ? opop->subitem_local_name : "", - opop->subitem_local_index, - op->rna_path, - ptr_src->owner_id->name); + CLOG_DEBUG(&LOG, + "Failed to find source sub-item '%s' (%d) of '%s' in old override data '%s'", + opop->subitem_local_name != nullptr ? opop->subitem_local_name : "", + opop->subitem_local_index, + op->rna_path, + ptr_src->owner_id->name); } } @@ -1359,21 +1354,19 @@ static void rna_property_override_check_resync(Main *bmain, if (ID_IS_LINKED(id_owner_src)) { id_owner_src->lib->runtime->tag |= LIBRARY_TAG_RESYNC_REQUIRED; } - CLOG_INFO(&LOG, - 3, - "Local override %s detected as needing resync due to mismatch in its used IDs", - id_owner_dst->name); + CLOG_DEBUG(&LOG, + "Local override %s detected as needing resync due to mismatch in its used IDs", + id_owner_dst->name); } if ((id_owner_src->override_library->reference->tag & ID_TAG_LIBOVERRIDE_NEED_RESYNC) != 0) { id_owner_dst->tag |= ID_TAG_LIBOVERRIDE_NEED_RESYNC; if (ID_IS_LINKED(id_owner_src)) { id_owner_src->lib->runtime->tag |= LIBRARY_TAG_RESYNC_REQUIRED; } - CLOG_INFO(&LOG, - 3, - "Local override %s detected as needing resync as its liboverride reference is " - "already tagged for resync", - id_owner_dst->name); + CLOG_DEBUG(&LOG, + "Local override %s detected as needing resync as its liboverride reference is " + "already tagged for resync", + id_owner_dst->name); } } @@ -1392,7 +1385,7 @@ static void rna_property_override_apply_ex(Main *bmain, !ELEM(opop->operation, LIBOVERRIDE_OP_INSERT_AFTER, LIBOVERRIDE_OP_INSERT_BEFORE)) { if (!do_insert) { - CLOG_INFO(&LOG, 5, "Skipping insert override operations in first pass (%s)", op->rna_path); + CLOG_DEBUG(&LOG, "Skipping insert override operations in first pass (%s)", op->rna_path); } continue; } @@ -1402,11 +1395,10 @@ static void rna_property_override_apply_ex(Main *bmain, rna_property_override_collection_subitem_lookup(rnaapply_ctx); if (!rna_property_override_operation_apply(bmain, rnaapply_ctx)) { - CLOG_INFO(&LOG, - 4, - "Failed to apply '%s' override operation on %s\n", - op->rna_path, - rnaapply_ctx.ptr_src.owner_id->name); + CLOG_DEBUG(&LOG, + "Failed to apply '%s' override operation on %s\n", + op->rna_path, + rnaapply_ctx.ptr_src.owner_id->name); } } @@ -1438,12 +1430,11 @@ static bool override_apply_property_check_skip(Main *bmain, /* IDProperties case. */ if (rnaapply_ctx.prop_dst->magic != RNA_MAGIC) { - CLOG_INFO(&LOG, - 2, - "%s: Ignoring local override on ID pointer custom property '%s', as requested by " - "RNA_OVERRIDE_APPLY_FLAG_IGNORE_ID_POINTERS flag", - id_ptr_dst->owner_id->name, - op->rna_path); + CLOG_DEBUG(&LOG, + "%s: Ignoring local override on ID pointer custom property '%s', as requested by " + "RNA_OVERRIDE_APPLY_FLAG_IGNORE_ID_POINTERS flag", + id_ptr_dst->owner_id->name, + op->rna_path); return true; } @@ -1457,12 +1448,11 @@ static bool override_apply_property_check_skip(Main *bmain, BLI_assert(id_ptr_dst->owner_id == rna_property_override_property_real_id_owner( bmain, &rnaapply_ctx.ptr_dst, nullptr, nullptr)); - CLOG_INFO(&LOG, - 2, - "%s: Ignoring local override on ID pointer property '%s', as requested by " - "RNA_OVERRIDE_APPLY_FLAG_IGNORE_ID_POINTERS flag", - id_ptr_dst->owner_id->name, - op->rna_path); + CLOG_DEBUG(&LOG, + "%s: Ignoring local override on ID pointer property '%s', as requested by " + "RNA_OVERRIDE_APPLY_FLAG_IGNORE_ID_POINTERS flag", + id_ptr_dst->owner_id->name, + op->rna_path); return true; } break; @@ -1471,12 +1461,11 @@ static bool override_apply_property_check_skip(Main *bmain, /* For collections of ID pointers just completely skip the override ops here... A tad brutal, * but this is a backup 'fix the mess' tool, and in practice this should never be an issue. * Can always be refined later if needed. */ - CLOG_INFO(&LOG, - 2, - "%s: Ignoring all local override on ID pointer collection property '%s', as " - "requested by RNA_OVERRIDE_APPLY_FLAG_IGNORE_ID_POINTERS flag", - id_ptr_dst->owner_id->name, - op->rna_path); + CLOG_DEBUG(&LOG, + "%s: Ignoring all local override on ID pointer collection property '%s', as " + "requested by RNA_OVERRIDE_APPLY_FLAG_IGNORE_ID_POINTERS flag", + id_ptr_dst->owner_id->name, + op->rna_path); return true; } default: @@ -1529,16 +1518,15 @@ void RNA_struct_override_apply(Main *bmain, &rnaapply_ctx.prop_src, &rnaapply_ctx.ptr_item_src))) { - CLOG_INFO(&LOG, - 4, - "Failed to apply library override operation to '%s.%s' " - "(could not resolve some properties, local: %d, override: %d)", - static_cast(id_ptr_src->owner_id)->name, - op->rna_path, - RNA_path_resolve_property( - id_ptr_dst, op->rna_path, &rnaapply_ctx.ptr_dst, &rnaapply_ctx.prop_dst), - RNA_path_resolve_property( - id_ptr_src, op->rna_path, &rnaapply_ctx.ptr_src, &rnaapply_ctx.prop_src)); + CLOG_DEBUG(&LOG, + "Failed to apply library override operation to '%s.%s' " + "(could not resolve some properties, local: %d, override: %d)", + static_cast(id_ptr_src->owner_id)->name, + op->rna_path, + RNA_path_resolve_property( + id_ptr_dst, op->rna_path, &rnaapply_ctx.ptr_dst, &rnaapply_ctx.prop_dst), + RNA_path_resolve_property( + id_ptr_src, op->rna_path, &rnaapply_ctx.ptr_src, &rnaapply_ctx.prop_src)); continue; } diff --git a/source/blender/makesrna/intern/rna_rna.cc b/source/blender/makesrna/intern/rna_rna.cc index 2740f5fd2b2..f706dbb4fa9 100644 --- a/source/blender/makesrna/intern/rna_rna.cc +++ b/source/blender/makesrna/intern/rna_rna.cc @@ -1624,11 +1624,11 @@ static void rna_property_override_diff_propptr(Main *bmain, /* In case one of the owner of the checked property is tagged as needing resync, do * not change the 'match reference' status of its ID pointer properties overrides, * since many non-matching ones are likely due to missing resync. */ - CLOG_INFO(&LOG_COMPARE_OVERRIDE, - 4, - "Not checking matching ID pointer properties, since owner %s is tagged as " - "needing resync.\n", - id_a->name); + CLOG_DEBUG( + &LOG_COMPARE_OVERRIDE, + "Not checking matching ID pointer properties, since owner %s is tagged as " + "needing resync.\n", + id_a->name); } else if (id_a->override_library != nullptr && id_a->override_library->reference == id_b) diff --git a/source/blender/nodes/shader/materialx/group_nodes.cc b/source/blender/nodes/shader/materialx/group_nodes.cc index eac37dbceb8..4c25e92dd3a 100644 --- a/source/blender/nodes/shader/materialx/group_nodes.cc +++ b/source/blender/nodes/shader/materialx/group_nodes.cc @@ -87,12 +87,11 @@ NodeItem GroupOutputNodeParser::compute() NodeItem GroupOutputNodeParser::compute_full() { - CLOG_INFO(LOG_IO_MATERIALX, - 1, - "%s [%d] => %s", - node_->name, - node_->typeinfo->type_legacy, - NodeItem::type(to_type_).c_str()); + CLOG_DEBUG(LOG_IO_MATERIALX, + "%s [%d] => %s", + node_->name, + node_->typeinfo->type_legacy, + NodeItem::type(to_type_).c_str()); #ifdef USE_MATERIALX_NODEGRAPH /* Checking if output was already computed */ @@ -136,7 +135,6 @@ NodeItem GroupInputNodeParser::compute() NodeItem GroupInputNodeParser::compute_full() { CLOG_INFO(LOG_IO_MATERIALX, - 1, "%s [%d] => %s", node_->name, node_->typeinfo->type_legacy, diff --git a/source/blender/nodes/shader/materialx/material.cc b/source/blender/nodes/shader/materialx/material.cc index 337b61eb00f..08b7226c751 100644 --- a/source/blender/nodes/shader/materialx/material.cc +++ b/source/blender/nodes/shader/materialx/material.cc @@ -52,7 +52,7 @@ MaterialX::DocumentPtr export_to_materialx(Depsgraph *depsgraph, Material *material, const ExportParams &export_params) { - CLOG_INFO(LOG_IO_MATERIALX, 0, "Material: %s", material->id.name); + CLOG_DEBUG(LOG_IO_MATERIALX, "Material: %s", material->id.name); MaterialX::DocumentPtr doc = MaterialX::createDocument(); NodeItem output_item; @@ -82,11 +82,10 @@ MaterialX::DocumentPtr export_to_materialx(Depsgraph *depsgraph, /* This node is expected to have a specific name to link up to USD. */ graph.set_output_node_name(output_item); - CLOG_INFO(LOG_IO_MATERIALX, - 1, - "Material: %s\n%s", - material->id.name, - MaterialX::writeToXmlString(doc).c_str()); + CLOG_DEBUG(LOG_IO_MATERIALX, + "Material: %s\n%s", + material->id.name, + MaterialX::writeToXmlString(doc).c_str()); return doc; } diff --git a/source/blender/nodes/shader/materialx/node_graph.cc b/source/blender/nodes/shader/materialx/node_graph.cc index e64588054af..07fb006688b 100644 --- a/source/blender/nodes/shader/materialx/node_graph.cc +++ b/source/blender/nodes/shader/materialx/node_graph.cc @@ -77,7 +77,7 @@ NodeGraph::NodeGraph(const NodeGraph &parent, const StringRef child_name) MaterialX::NodeGraphPtr graph = parent.graph_element_->getChildOfType( valid_child_name); if (!graph) { - CLOG_INFO(LOG_IO_MATERIALX, 1, "", valid_child_name.c_str()); + CLOG_DEBUG(LOG_IO_MATERIALX, "", valid_child_name.c_str()); graph = parent.graph_element_->addChild(valid_child_name); } graph_element_ = graph.get(); diff --git a/source/blender/nodes/shader/materialx/node_item.cc b/source/blender/nodes/shader/materialx/node_item.cc index a406d7a098e..515715ba5fd 100644 --- a/source/blender/nodes/shader/materialx/node_item.cc +++ b/source/blender/nodes/shader/materialx/node_item.cc @@ -832,7 +832,7 @@ NodeItem NodeItem::create_node(const std::string &category, Type type) const { const std::string name = NodeGraph::unique_anonymous_node_name(graph_); const std::string type_str = NodeItem::type(type); - CLOG_INFO(LOG_IO_MATERIALX, 2, "<%s type=%s>", category.c_str(), type_str.c_str()); + CLOG_DEBUG(LOG_IO_MATERIALX, "<%s type=%s>", category.c_str(), type_str.c_str()); NodeItem res = empty(); /* Surface-shader nodes and materials are added directly to the document, * otherwise to the node-graph. */ diff --git a/source/blender/nodes/shader/materialx/node_parser.cc b/source/blender/nodes/shader/materialx/node_parser.cc index 7c63995f34f..3f2a05009cc 100644 --- a/source/blender/nodes/shader/materialx/node_parser.cc +++ b/source/blender/nodes/shader/materialx/node_parser.cc @@ -39,12 +39,11 @@ NodeItem NodeParser::compute_full() const std::string res_node_name = node_name(); res = graph_.get_node(res_node_name); if (!res.node) { - CLOG_INFO(LOG_IO_MATERIALX, - 1, - "%s [%d] => %s", - node_->name, - node_->typeinfo->type_legacy, - NodeItem::type(to_type_).c_str()); + CLOG_DEBUG(LOG_IO_MATERIALX, + "%s [%d] => %s", + node_->name, + node_->typeinfo->type_legacy, + NodeItem::type(to_type_).c_str()); res = compute(); if (res.node) { diff --git a/source/blender/python/intern/bpy_interface.cc b/source/blender/python/intern/bpy_interface.cc index e5c31d665eb..179448c9318 100644 --- a/source/blender/python/intern/bpy_interface.cc +++ b/source/blender/python/intern/bpy_interface.cc @@ -347,9 +347,8 @@ void BPY_python_start(bContext *C, int argc, const char **argv) PyStatus status; /* To narrow down reports where the systems Python is inexplicably used, see: #98131. */ - CLOG_INFO( + CLOG_DEBUG( BPY_LOG_INTERFACE, - 2, "Initializing %s support for the systems Python environment such as 'PYTHONPATH' and " "the user-site directory.", py_use_system_env ? "*with*" : "*without*"); @@ -793,7 +792,6 @@ bool BPY_context_member_get(bContext *C, const char *member, bContextDataResult } else { CLOG_INFO(BPY_LOG_CONTEXT, - 1, "'%s' list item not a valid type in sequence type '%s'", member, Py_TYPE(item)->tp_name); @@ -807,14 +805,14 @@ bool BPY_context_member_get(bContext *C, const char *member, bContextDataResult if (done == false) { if (item) { - CLOG_INFO(BPY_LOG_CONTEXT, 1, "'%s' not a valid type", member); + CLOG_INFO(BPY_LOG_CONTEXT, "'%s' not a valid type", member); } else { - CLOG_INFO(BPY_LOG_CONTEXT, 1, "'%s' not found", member); + CLOG_INFO(BPY_LOG_CONTEXT, "'%s' not found", member); } } else { - CLOG_INFO(BPY_LOG_CONTEXT, 2, "'%s' found", member); + CLOG_DEBUG(BPY_LOG_CONTEXT, "'%s' found", member); } if (use_gil) { diff --git a/source/blender/python/intern/bpy_rna.cc b/source/blender/python/intern/bpy_rna.cc index 285339d814d..16c66a28178 100644 --- a/source/blender/python/intern/bpy_rna.cc +++ b/source/blender/python/intern/bpy_rna.cc @@ -8166,7 +8166,7 @@ static PyObject *pyrna_srna_ExternalType(StructRNA *srna) newclass = nullptr; } else { - CLOG_INFO(BPY_LOG_RNA, 2, "SRNA sub-classed: '%s'", idname); + CLOG_TRACE(BPY_LOG_RNA, "SRNA sub-classed: '%s'", idname); } } } diff --git a/source/blender/render/hydra/light_tasks_delegate.cc b/source/blender/render/hydra/light_tasks_delegate.cc index 8c5bd99d328..635c95083e7 100644 --- a/source/blender/render/hydra/light_tasks_delegate.cc +++ b/source/blender/render/hydra/light_tasks_delegate.cc @@ -16,13 +16,13 @@ LightTasksDelegate::LightTasksDelegate(pxr::HdRenderIndex *parent_index, skydome_task_id_ = GetDelegateID().AppendElementString("skydomeTask"); GetRenderIndex().InsertTask(this, skydome_task_id_); - CLOG_INFO(LOG_HYDRA_RENDER, 1, "%s", simple_task_id_.GetText()); - CLOG_INFO(LOG_HYDRA_RENDER, 1, "%s", skydome_task_id_.GetText()); + CLOG_DEBUG(LOG_HYDRA_RENDER, "%s", simple_task_id_.GetText()); + CLOG_DEBUG(LOG_HYDRA_RENDER, "%s", skydome_task_id_.GetText()); } pxr::VtValue LightTasksDelegate::Get(pxr::SdfPath const &id, pxr::TfToken const &key) { - CLOG_INFO(LOG_HYDRA_RENDER, 3, "%s, %s", id.GetText(), key.GetText()); + CLOG_DEBUG(LOG_HYDRA_RENDER, "%s, %s", id.GetText(), key.GetText()); if (key == pxr::HdTokens->params) { if (id == simple_task_id_) { diff --git a/source/blender/render/hydra/python.cc b/source/blender/render/hydra/python.cc index 5e58fbc1c13..67d60289136 100644 --- a/source/blender/render/hydra/python.cc +++ b/source/blender/render/hydra/python.cc @@ -37,7 +37,7 @@ static PyObject *engine_create_func(PyObject * /*self*/, PyObject *args) RenderEngine *bl_engine = pyrna_to_pointer(pyengine, &RNA_RenderEngine); - CLOG_INFO(LOG_HYDRA_RENDER, 1, "Engine %s", engine_type); + CLOG_DEBUG(LOG_HYDRA_RENDER, "Engine %s", engine_type); Engine *engine = nullptr; try { if (STREQ(engine_type, "VIEWPORT")) { @@ -54,7 +54,7 @@ static PyObject *engine_create_func(PyObject * /*self*/, PyObject *args) CLOG_ERROR(LOG_HYDRA_RENDER, "%s", e.what()); } - CLOG_INFO(LOG_HYDRA_RENDER, 1, "Engine %p", engine); + CLOG_DEBUG(LOG_HYDRA_RENDER, "Engine %p", engine); return PyLong_FromVoidPtr(engine); } @@ -66,7 +66,7 @@ static PyObject *engine_free_func(PyObject * /*self*/, PyObject *args) } Engine *engine = static_cast(PyLong_AsVoidPtr(pyengine)); - CLOG_INFO(LOG_HYDRA_RENDER, 1, "Engine %p", engine); + CLOG_DEBUG(LOG_HYDRA_RENDER, "Engine %p", engine); delete engine; Py_RETURN_NONE; @@ -83,7 +83,7 @@ static PyObject *engine_update_func(PyObject * /*self*/, PyObject *args) Depsgraph *depsgraph = pyrna_to_pointer(pydepsgraph, &RNA_Depsgraph); bContext *context = pyrna_to_pointer(pycontext, &RNA_Context); - CLOG_INFO(LOG_HYDRA_RENDER, 2, "Engine %p", engine); + CLOG_DEBUG(LOG_HYDRA_RENDER, "Engine %p", engine); engine->sync(depsgraph, context); Py_RETURN_NONE; @@ -98,7 +98,7 @@ static PyObject *engine_render_func(PyObject * /*self*/, PyObject *args) Engine *engine = static_cast(PyLong_AsVoidPtr(pyengine)); - CLOG_INFO(LOG_HYDRA_RENDER, 2, "Engine %p", engine); + CLOG_DEBUG(LOG_HYDRA_RENDER, "Engine %p", engine); /* Allow Blender to execute other Python scripts. */ Py_BEGIN_ALLOW_THREADS; @@ -118,7 +118,7 @@ static PyObject *engine_view_draw_func(PyObject * /*self*/, PyObject *args) ViewportEngine *engine = static_cast(PyLong_AsVoidPtr(pyengine)); bContext *context = pyrna_to_pointer(pycontext, &RNA_Context); - CLOG_INFO(LOG_HYDRA_RENDER, 3, "Engine %p", engine); + CLOG_DEBUG(LOG_HYDRA_RENDER, "Engine %p", engine); /* Allow Blender to execute other Python scripts. */ Py_BEGIN_ALLOW_THREADS; @@ -156,7 +156,7 @@ static PyObject *engine_set_render_setting_func(PyObject * /*self*/, PyObject *a Engine *engine = static_cast(PyLong_AsVoidPtr(pyengine)); - CLOG_INFO(LOG_HYDRA_RENDER, 3, "Engine %p: %s", engine, key); + CLOG_DEBUG(LOG_HYDRA_RENDER, "Engine %p: %s", engine, key); engine->set_render_setting(key, get_setting_val(pyval)); Py_RETURN_NONE; diff --git a/source/blender/render/hydra/render_task_delegate.cc b/source/blender/render/hydra/render_task_delegate.cc index fda15d4e36b..895ca83cc3f 100644 --- a/source/blender/render/hydra/render_task_delegate.cc +++ b/source/blender/render/hydra/render_task_delegate.cc @@ -34,12 +34,12 @@ RenderTaskDelegate::RenderTaskDelegate(pxr::HdRenderIndex *parent_index, * the former seems to use multisample. */ task_params_.useAovMultiSample = false; - CLOG_INFO(LOG_HYDRA_RENDER, 1, "%s", task_id_.GetText()); + CLOG_DEBUG(LOG_HYDRA_RENDER, "%s", task_id_.GetText()); } pxr::VtValue RenderTaskDelegate::Get(pxr::SdfPath const &id, pxr::TfToken const &key) { - CLOG_INFO(LOG_HYDRA_RENDER, 3, "%s, %s", id.GetText(), key.GetText()); + CLOG_DEBUG(LOG_HYDRA_RENDER, "%s, %s", id.GetText(), key.GetText()); if (key == pxr::HdTokens->params) { return pxr::VtValue(task_params_); @@ -53,14 +53,14 @@ pxr::VtValue RenderTaskDelegate::Get(pxr::SdfPath const &id, pxr::TfToken const pxr::TfTokenVector RenderTaskDelegate::GetTaskRenderTags(pxr::SdfPath const &id) { - CLOG_INFO(LOG_HYDRA_RENDER, 3, "%s", id.GetText()); + CLOG_DEBUG(LOG_HYDRA_RENDER, "%s", id.GetText()); return {pxr::HdRenderTagTokens->geometry}; } pxr::HdRenderBufferDescriptor RenderTaskDelegate::GetRenderBufferDescriptor(pxr::SdfPath const &id) { - CLOG_INFO(LOG_HYDRA_RENDER, 3, "%s", id.GetText()); + CLOG_DEBUG(LOG_HYDRA_RENDER, "%s", id.GetText()); return buffer_descriptors_[id]; } @@ -140,7 +140,7 @@ void RenderTaskDelegate::add_aov(pxr::TfToken const &aov_key) task_params_.aovBindings.push_back(binding); render_index.GetChangeTracker().MarkTaskDirty(task_id_, pxr::HdChangeTracker::DirtyParams); - CLOG_INFO(LOG_HYDRA_RENDER, 1, "%s", aov_key.GetText()); + CLOG_DEBUG(LOG_HYDRA_RENDER, "%s", aov_key.GetText()); } void RenderTaskDelegate::read_aov(pxr::TfToken const &aov_key, void *data) @@ -247,7 +247,7 @@ void GPURenderTaskDelegate::add_aov(pxr::TfToken const &aov_key) GPU_TEXTURE_USAGE_GENERAL, nullptr); - CLOG_INFO(LOG_HYDRA_RENDER, 1, "%s", aov_key.GetText()); + CLOG_DEBUG(LOG_HYDRA_RENDER, "%s", aov_key.GetText()); } void GPURenderTaskDelegate::read_aov(pxr::TfToken const &aov_key, void *data) @@ -290,7 +290,7 @@ void GPURenderTaskDelegate::bind() glGenVertexArrays(1, &VAO_); glBindVertexArray(VAO_); } - CLOG_INFO(LOG_HYDRA_RENDER, 3, "bind"); + CLOG_DEBUG(LOG_HYDRA_RENDER, "bind"); } void GPURenderTaskDelegate::unbind() @@ -303,7 +303,7 @@ void GPURenderTaskDelegate::unbind() GPU_framebuffer_free(framebuffer_); framebuffer_ = nullptr; } - CLOG_INFO(LOG_HYDRA_RENDER, 3, "unbind"); + CLOG_DEBUG(LOG_HYDRA_RENDER, "unbind"); } GPUTexture *GPURenderTaskDelegate::get_aov_texture(pxr::TfToken const &aov_key) diff --git a/source/blender/render/intern/engine.cc b/source/blender/render/intern/engine.cc index 1607594994b..84e84312304 100644 --- a/source/blender/render/intern/engine.cc +++ b/source/blender/render/intern/engine.cc @@ -957,7 +957,7 @@ static void engine_render_view_layer(Render *re, * dependency graph, which is only allowed if there is no grease * pencil (pipeline is taking care of that). */ if (!RE_engine_test_break(engine) && engine->depsgraph != nullptr) { - CLOG_INFO(&LOG, 0, "Rendering grease pencil"); + CLOG_INFO(&LOG, "Rendering grease pencil"); DRW_render_gpencil(engine, engine->depsgraph); } } @@ -1095,8 +1095,8 @@ bool RE_engine_render(Render *re, bool do_all) if (type->render) { FOREACH_VIEW_LAYER_TO_RENDER_BEGIN (re, view_layer_iter) { - CLOG_INFO(&LOG, 0, "Start rendering: %s, %s", re->scene->id.name + 2, view_layer_iter->name); - CLOG_INFO(&LOG, 0, "Engine: %s", engine->type->name); + CLOG_INFO(&LOG, "Start rendering: %s, %s", re->scene->id.name + 2, view_layer_iter->name); + CLOG_INFO(&LOG, "Engine: %s", engine->type->name); const bool use_grease_pencil = (view_layer_iter->layflag & SCE_LAY_GREASE_PENCIL) != 0; engine_render_view_layer(re, engine, view_layer_iter, true, use_grease_pencil); @@ -1158,7 +1158,7 @@ bool RE_engine_render(Render *re, bool do_all) #ifdef WITH_FREESTYLE if (re->r.mode & R_EDGE_FRS) { - CLOG_INFO(&LOG, 0, "Rendering freestyle"); + CLOG_INFO(&LOG, "Rendering freestyle"); RE_RenderFreestyleExternal(re); } #endif diff --git a/source/blender/render/intern/pipeline.cc b/source/blender/render/intern/pipeline.cc index ce183025a2c..e57e3d82037 100644 --- a/source/blender/render/intern/pipeline.cc +++ b/source/blender/render/intern/pipeline.cc @@ -205,7 +205,7 @@ static void stats_background(void * /*arg*/, RenderStats *rs) std::scoped_lock lock(mutex); if (!G.quiet) { - CLOG_STR_INFO(&LOG, 0, rs->infostr); + CLOG_STR_INFO(&LOG, rs->infostr); /* Flush stdout to be sure python callbacks are printing stuff after blender. */ fflush(stdout); } @@ -1364,7 +1364,7 @@ static void do_render_compositor(Render *re) blender::compositor::OutputTypes::Previews; } - CLOG_STR_INFO(&LOG, 0, "Executing compositor"); + CLOG_STR_INFO(&LOG, "Executing compositor"); blender::compositor::RenderContext compositor_render_context; LISTBASE_FOREACH (RenderView *, rv, &re->result->views) { COM_execute(re, @@ -1507,7 +1507,7 @@ static void do_render_sequencer(Render *re) int view_id, tot_views; int re_x, re_y; - CLOG_STR_INFO(&LOG, 0, "Executing sequencer"); + CLOG_STR_INFO(&LOG, "Executing sequencer"); re->i.cfra = cfra; @@ -2349,7 +2349,7 @@ static bool do_write_image_or_movie( } if (!G.quiet) { - CLOG_STR_INFO(&LOG, 0, message.c_str()); + CLOG_STR_INFO(&LOG, message.c_str()); /* Flush stdout to be sure python callbacks are printing stuff after blender. */ fflush(stdout); } @@ -2407,10 +2407,10 @@ void RE_RenderAnim(Render *re, int tfra) { if (sfra == efra) { - CLOG_INFO(&LOG, 0, "Rendering single frame (frame %d)", sfra); + CLOG_INFO(&LOG, "Rendering single frame (frame %d)", sfra); } else { - CLOG_INFO(&LOG, 0, "Rendering animation (frames %d..%d)", sfra, efra); + CLOG_INFO(&LOG, "Rendering animation (frames %d..%d)", sfra, efra); } /* Call hooks before taking a copy of scene->r, so user can alter the render settings prior to diff --git a/source/blender/windowmanager/intern/wm_event_system.cc b/source/blender/windowmanager/intern/wm_event_system.cc index a5c9c04625b..a8a3b4f9687 100644 --- a/source/blender/windowmanager/intern/wm_event_system.cc +++ b/source/blender/windowmanager/intern/wm_event_system.cc @@ -1176,7 +1176,7 @@ static void wm_operator_reports(bContext *C, std::string pystring = WM_operator_pystring(C, op, false, true); if (retval & OPERATOR_FINISHED) { - CLOG_INFO(WM_LOG_OPERATORS, 0, "Finished %s", pystring.c_str()); + CLOG_INFO(WM_LOG_OPERATORS, "Finished %s", pystring.c_str()); if (caller_owns_reports == false) { /* Print out reports to console. @@ -1193,7 +1193,7 @@ static void wm_operator_reports(bContext *C, } } else { - CLOG_INFO(WM_LOG_OPERATORS, 0, "Cancelled %s", pystring.c_str()); + CLOG_INFO(WM_LOG_OPERATORS, "Cancelled %s", pystring.c_str()); } /* Refresh Info Editor with reports immediately, even if op returned #OPERATOR_CANCELLED. */ @@ -1607,7 +1607,7 @@ static wmOperatorStatus wm_operator_invoke(bContext *C, /* If `reports == nullptr`, they'll be initialized. */ wmOperator *op = wm_operator_create(wm, ot, properties, reports); - CLOG_INFO(WM_LOG_OPERATORS, 0, "Started %s", WM_operator_pystring(C, op, false, true).c_str()); + CLOG_INFO(WM_LOG_OPERATORS, "Started %s", WM_operator_pystring(C, op, false, true).c_str()); const bool is_nested_call = (wm->op_undo_depth != 0); @@ -1621,12 +1621,11 @@ static wmOperatorStatus wm_operator_invoke(bContext *C, } if ((event == nullptr) || (event->type != MOUSEMOVE)) { - CLOG_INFO(WM_LOG_EVENTS, - 2, - "handle evt %d win %p op %s", - event ? event->type : 0, - CTX_wm_screen(C)->active_region, - ot->idname); + CLOG_DEBUG(WM_LOG_EVENTS, + "handle evt %d win %p op %s", + event ? event->type : 0, + CTX_wm_screen(C)->active_region, + ot->idname); } if (op->type->invoke && event) { @@ -3107,13 +3106,12 @@ static eHandlerActionFlag wm_handlers_do_keymap_with_keymap_handler( action |= wm_handler_operator_call( C, handlers, &handler->head, event, kmi->ptr, kmi->idname); - CLOG_INFO(WM_LOG_EVENTS, - 2, - "keymap '%s', %s, %s, event: %s", - keymap->idname, - keymap_handler_log_kmi_op_str(C, kmi).c_str(), - keymap_handler_log_action_str(action), - keymap_handler_log_kmi_event_str(kmi).value_or("").c_str()); + CLOG_DEBUG(WM_LOG_EVENTS, + "keymap '%s', %s, %s, event: %s", + keymap->idname, + keymap_handler_log_kmi_op_str(C, kmi).c_str(), + keymap_handler_log_action_str(action), + keymap_handler_log_kmi_event_str(kmi).value_or("").c_str()); if (action & WM_HANDLER_BREAK) { /* Not always_pass here, it denotes removed handler_base. */ @@ -3650,7 +3648,7 @@ static eHandlerActionFlag wm_handlers_do(bContext *C, wmEvent *event, ListBase * event->keymodifier = event->prev_press_keymodifier; event->direction = direction; - CLOG_INFO(WM_LOG_EVENTS, 3, "handling CLICK_DRAG"); + CLOG_DEBUG(WM_LOG_EVENTS, "handling CLICK_DRAG"); action |= wm_handlers_do_intern(C, win, event, handlers); @@ -3663,7 +3661,7 @@ static eHandlerActionFlag wm_handlers_do(bContext *C, wmEvent *event, ListBase * win->event_queue_check_click = false; if (!((action & WM_HANDLER_BREAK) == 0 || wm_action_not_handled(action))) { /* Only disable when handled as other handlers may use this drag event. */ - CLOG_INFO(WM_LOG_EVENTS, 3, "canceling CLICK_DRAG: drag was generated & handled"); + CLOG_DEBUG(WM_LOG_EVENTS, "canceling CLICK_DRAG: drag was generated & handled"); win->event_queue_check_drag = false; } } @@ -3671,7 +3669,7 @@ static eHandlerActionFlag wm_handlers_do(bContext *C, wmEvent *event, ListBase * } else { if (win->event_queue_check_drag) { - CLOG_INFO(WM_LOG_EVENTS, 3, "canceling CLICK_DRAG: motion event was handled"); + CLOG_DEBUG(WM_LOG_EVENTS, "canceling CLICK_DRAG: motion event was handled"); win->event_queue_check_drag = false; } } @@ -3688,7 +3686,7 @@ static eHandlerActionFlag wm_handlers_do(bContext *C, wmEvent *event, ListBase * if ((event->flag & WM_EVENT_IS_REPEAT) == 0) { win->event_queue_check_click = true; - CLOG_INFO(WM_LOG_EVENTS, 3, "detecting CLICK_DRAG: press event detected"); + CLOG_DEBUG(WM_LOG_EVENTS, "detecting CLICK_DRAG: press event detected"); win->event_queue_check_drag = true; win->event_queue_check_drag_handled = false; @@ -3702,8 +3700,7 @@ static eHandlerActionFlag wm_handlers_do(bContext *C, wmEvent *event, ListBase * /* Support releasing modifier keys without canceling the drag event, see #89989. */ } else { - CLOG_INFO( - WM_LOG_EVENTS, 3, "CLICK_DRAG: canceling (release event didn't match press)"); + CLOG_DEBUG(WM_LOG_EVENTS, "CLICK_DRAG: canceling (release event didn't match press)"); win->event_queue_check_drag = false; } } @@ -3716,9 +3713,8 @@ static eHandlerActionFlag wm_handlers_do(bContext *C, wmEvent *event, ListBase * if (WM_event_drag_test(event, event->prev_press_xy)) { win->event_queue_check_click = false; if (win->event_queue_check_drag) { - CLOG_INFO(WM_LOG_EVENTS, - 3, - "CLICK_DRAG: canceling (key-release exceeds drag threshold)"); + CLOG_DEBUG(WM_LOG_EVENTS, + "CLICK_DRAG: canceling (key-release exceeds drag threshold)"); win->event_queue_check_drag = false; } } @@ -3730,7 +3726,7 @@ static eHandlerActionFlag wm_handlers_do(bContext *C, wmEvent *event, ListBase * copy_v2_v2_int(event->xy, event->prev_press_xy); event->val = KM_CLICK; - CLOG_INFO(WM_LOG_EVENTS, 3, "CLICK: handling"); + CLOG_DEBUG(WM_LOG_EVENTS, "CLICK: handling"); action |= wm_handlers_do_intern(C, win, event, handlers); @@ -3756,10 +3752,9 @@ static eHandlerActionFlag wm_handlers_do(bContext *C, wmEvent *event, ListBase * win->event_queue_check_click = false; if (win->event_queue_check_drag) { - CLOG_INFO(WM_LOG_EVENTS, - 3, - "CLICK_DRAG: canceling (button event was handled: value=%d)", - event->val); + CLOG_DEBUG(WM_LOG_EVENTS, + "CLICK_DRAG: canceling (button event was handled: value=%d)", + event->val); win->event_queue_check_drag = false; } } @@ -4140,13 +4135,13 @@ void wm_event_do_handlers(bContext *C) event->flag |= WM_EVENT_IS_CONSECUTIVE; } else if (is_consecutive || WM_event_consecutive_gesture_test_break(win, event)) { - CLOG_INFO(WM_LOG_EVENTS, 3, "consecutive gesture break (%d)", event->type); + CLOG_DEBUG(WM_LOG_EVENTS, "consecutive gesture break (%d)", event->type); win->event_queue_consecutive_gesture_type = EVENT_NONE; WM_event_consecutive_data_free(win); } } else if (is_consecutive) { - CLOG_INFO(WM_LOG_EVENTS, 3, "consecutive gesture begin (%d)", event->type); + CLOG_DEBUG(WM_LOG_EVENTS, "consecutive gesture begin (%d)", event->type); win->event_queue_consecutive_gesture_type = event->type; copy_v2_v2_int(win->event_queue_consecutive_gesture_xy, event->xy); /* While this should not be set, it's harmless to free here. */ @@ -4165,7 +4160,7 @@ void wm_event_do_handlers(bContext *C) /* Take care of pie event filter. */ if (wm_event_pie_filter(win, event)) { if (!ISMOUSE_MOTION(event->type)) { - CLOG_INFO(WM_LOG_EVENTS, 3, "event filtered due to pie button pressed"); + CLOG_DEBUG(WM_LOG_EVENTS, "event filtered due to pie button pressed"); } BLI_remlink(&win->runtime->event_queue, event); wm_event_free_last_handled(win, event); @@ -5816,7 +5811,7 @@ static void wm_event_state_update_and_click_set_ex(wmEvent *event, if (check_double_click && wm_event_is_double_click(event, event_time_ms, *event_state_prev_press_time_ms_p)) { - CLOG_INFO(WM_LOG_EVENTS, 3, "DBL_CLICK: detected"); + CLOG_DEBUG(WM_LOG_EVENTS, "DBL_CLICK: detected"); event->val = KM_DBL_CLICK; } else if (event->val == KM_PRESS) { @@ -6324,7 +6319,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, attach_ndof_data(&event, static_cast(customdata)); wm_event_add_intern(win, &event); - CLOG_INFO(WM_LOG_EVENTS, 1, "sending NDOF_MOTION, prev = %d %d", event.xy[0], event.xy[1]); + CLOG_INFO(WM_LOG_EVENTS, "sending NDOF_MOTION, prev = %d %d", event.xy[0], event.xy[1]); break; } diff --git a/source/blender/windowmanager/intern/wm_files.cc b/source/blender/windowmanager/intern/wm_files.cc index 35d8fa23a2f..462d80b2d60 100644 --- a/source/blender/windowmanager/intern/wm_files.cc +++ b/source/blender/windowmanager/intern/wm_files.cc @@ -960,19 +960,16 @@ static void file_read_reports_finalize(BlendFileReadReport *bf_reports) nullptr); CLOG_INFO( - &LOG, 0, "Blender file read in %.0fm%.2fs", duration_whole_minutes, duration_whole_seconds); + &LOG, "Blender file read in %.0fm%.2fs", duration_whole_minutes, duration_whole_seconds); CLOG_INFO(&LOG, - 0, " * Loading libraries: %.0fm%.2fs", duration_libraries_minutes, duration_libraries_seconds); CLOG_INFO(&LOG, - 0, " * Applying overrides: %.0fm%.2fs", duration_lib_override_minutes, duration_lib_override_seconds); CLOG_INFO(&LOG, - 0, " * Resyncing overrides: %.0fm%.2fs (%d root overrides), including recursive " "resyncs: %.0fm%.2fs)", duration_lib_override_resync_minutes, @@ -1373,7 +1370,7 @@ void wm_homefile_read_ex(bContext *C, else if (!use_factory_settings && BLI_exists(filepath_userdef)) { UserDef *userdef = BKE_blendfile_userdef_read(filepath_userdef, nullptr); if (userdef != nullptr) { - CLOG_INFO(&LOG, 0, "Read prefs: \"%s\"", filepath_userdef); + CLOG_INFO(&LOG, "Read prefs: \"%s\"", filepath_userdef); BKE_blender_userdef_data_set_and_free(userdef); userdef = nullptr; @@ -1430,7 +1427,7 @@ void wm_homefile_read_ex(bContext *C, BlendFileData *bfd = BKE_blendfile_read(filepath_startup, ¶ms, &bf_reports); if (bfd != nullptr) { - CLOG_INFO(&LOG, 0, "Read startup: \"%s\"", filepath_startup); + CLOG_INFO(&LOG, "Read startup: \"%s\"", filepath_startup); /* Frees the current main and replaces it with the new one read from file. */ BKE_blendfile_read_setup_readfile(C, @@ -1508,7 +1505,7 @@ void wm_homefile_read_ex(bContext *C, if (BLI_exists(temp_path)) { userdef_template = BKE_blendfile_userdef_read(temp_path, nullptr); if (userdef_template) { - CLOG_INFO(&LOG, 0, "Read prefs from app-template: \"%s\"", temp_path); + CLOG_INFO(&LOG, "Read prefs from app-template: \"%s\"", temp_path); } } if (userdef_template == nullptr) { diff --git a/source/blender/windowmanager/intern/wm_files_link.cc b/source/blender/windowmanager/intern/wm_files_link.cc index d299f7d1ee0..bc063a9b23a 100644 --- a/source/blender/windowmanager/intern/wm_files_link.cc +++ b/source/blender/windowmanager/intern/wm_files_link.cc @@ -924,7 +924,7 @@ static wmOperatorStatus wm_lib_relocate_exec_do(bContext *C, wmOperator *op, boo &lapp_params, bmain, flag, 0, CTX_data_scene(C), CTX_data_view_layer(C), nullptr); if (BLI_path_cmp(lib->runtime->filepath_abs, filepath) == 0) { - CLOG_INFO(&LOG, 4, "We are supposed to reload '%s' lib (%d)", lib->filepath, lib->id.us); + CLOG_DEBUG(&LOG, "We are supposed to reload '%s' lib (%d)", lib->filepath, lib->id.us); do_reload = true; @@ -934,8 +934,8 @@ static wmOperatorStatus wm_lib_relocate_exec_do(bContext *C, wmOperator *op, boo else { int totfiles = 0; - CLOG_INFO( - &LOG, 4, "We are supposed to relocate '%s' lib to new '%s' one", lib->filepath, libname); + CLOG_DEBUG( + &LOG, "We are supposed to relocate '%s' lib to new '%s' one", lib->filepath, libname); /* Check if something is indicated for relocate. */ prop = RNA_struct_find_property(op->ptr, "files"); @@ -963,13 +963,13 @@ static wmOperatorStatus wm_lib_relocate_exec_do(bContext *C, wmOperator *op, boo continue; } - CLOG_INFO(&LOG, 4, "\tCandidate new lib to reload datablocks from: %s", filepath); + CLOG_DEBUG(&LOG, "\tCandidate new lib to reload datablocks from: %s", filepath); BKE_blendfile_link_append_context_library_add(lapp_context, filepath, nullptr); } RNA_END; } else { - CLOG_INFO(&LOG, 4, "\tCandidate new lib to reload datablocks from: %s", filepath); + CLOG_DEBUG(&LOG, "\tCandidate new lib to reload datablocks from: %s", filepath); BKE_blendfile_link_append_context_library_add(lapp_context, filepath, nullptr); } } diff --git a/source/blender/windowmanager/intern/wm_operator_type.cc b/source/blender/windowmanager/intern/wm_operator_type.cc index df9a6425217..029390b0153 100644 --- a/source/blender/windowmanager/intern/wm_operator_type.cc +++ b/source/blender/windowmanager/intern/wm_operator_type.cc @@ -87,12 +87,12 @@ wmOperatorType *WM_operatortype_find(const char *idname, bool quiet) } if (!quiet) { - CLOG_INFO(WM_LOG_OPERATORS, 0, "Search for unknown operator '%s', '%s'", idname_bl, idname); + CLOG_INFO(WM_LOG_OPERATORS, "Search for unknown operator '%s', '%s'", idname_bl, idname); } } else { if (!quiet) { - CLOG_INFO(WM_LOG_OPERATORS, 0, "Search for empty operator"); + CLOG_INFO(WM_LOG_OPERATORS, "Search for empty operator"); } } diff --git a/source/blender/windowmanager/intern/wm_operators.cc b/source/blender/windowmanager/intern/wm_operators.cc index 55234644852..a48fea1498a 100644 --- a/source/blender/windowmanager/intern/wm_operators.cc +++ b/source/blender/windowmanager/intern/wm_operators.cc @@ -900,7 +900,7 @@ static bool operator_last_properties_init_impl(wmOperator *op, IDProperty *last_ RNA_PROP_END; if (changed) { - CLOG_INFO(WM_LOG_OPERATORS, 3, "Loading previous properties for '%s'", op->type->idname); + CLOG_DEBUG(WM_LOG_OPERATORS, "Loading previous properties for '%s'", op->type->idname); } IDP_MergeGroup(op->properties, replaceprops, true); IDP_FreeProperty(replaceprops); @@ -931,7 +931,7 @@ bool WM_operator_last_properties_store(wmOperator *op) if (op->properties) { if (!BLI_listbase_is_empty(&op->properties->data.group)) { - CLOG_INFO(WM_LOG_OPERATORS, 3, "Storing properties for '%s'", op->type->idname); + CLOG_DEBUG(WM_LOG_OPERATORS, "Storing properties for '%s'", op->type->idname); } op->type->last_properties = IDP_CopyProperty(op->properties); } diff --git a/source/blender/windowmanager/intern/wm_window.cc b/source/blender/windowmanager/intern/wm_window.cc index a3d3ff10da2..b1fc2d43443 100644 --- a/source/blender/windowmanager/intern/wm_window.cc +++ b/source/blender/windowmanager/intern/wm_window.cc @@ -1810,9 +1810,9 @@ static bool ghost_event_proc(GHOST_EventHandle ghost_event, GHOST_TUserDataPtr C const GHOST_TStringArray *stra = static_cast(ddd->data); if (stra->count) { - CLOG_INFO(WM_LOG_EVENTS, 1, "Drop %d files:", stra->count); + CLOG_INFO(WM_LOG_EVENTS, "Drop %d files:", stra->count); for (const char *path : blender::Span((char **)stra->strings, stra->count)) { - CLOG_INFO(WM_LOG_EVENTS, 1, "%s", path); + CLOG_INFO(WM_LOG_EVENTS, "%s", path); } /* Try to get icon type from extension of the first path. */ int icon = ED_file_extension_icon((char *)stra->strings[0]); diff --git a/source/blender/windowmanager/message_bus/intern/wm_message_bus.cc b/source/blender/windowmanager/message_bus/intern/wm_message_bus.cc index e852aa3096d..7446a0a5274 100644 --- a/source/blender/windowmanager/message_bus/intern/wm_message_bus.cc +++ b/source/blender/windowmanager/message_bus/intern/wm_message_bus.cc @@ -176,11 +176,10 @@ wmMsgSubscribeKey *WM_msg_subscribe_with_key(wmMsgBus *mbus, void WM_msg_publish_with_key(wmMsgBus *mbus, wmMsgSubscribeKey *msg_key) { - CLOG_INFO(WM_LOG_MSGBUS_SUB, - 2, - "tagging subscribers: (ptr=%p, len=%d)", - msg_key, - BLI_listbase_count(&msg_key->values)); + CLOG_DEBUG(WM_LOG_MSGBUS_SUB, + "tagging subscribers: (ptr=%p, len=%d)", + msg_key, + BLI_listbase_count(&msg_key->values)); LISTBASE_FOREACH (wmMsgSubscribeValueLink *, msg_lnk, &msg_key->values) { if (false) { /* Make an option? */ diff --git a/source/blender/windowmanager/message_bus/intern/wm_message_bus_rna.cc b/source/blender/windowmanager/message_bus/intern/wm_message_bus_rna.cc index 2d69b78540b..68907b18266 100644 --- a/source/blender/windowmanager/message_bus/intern/wm_message_bus_rna.cc +++ b/source/blender/windowmanager/message_bus/intern/wm_message_bus_rna.cc @@ -240,13 +240,12 @@ void WM_msg_publish_rna_params(wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_pa wmMsgSubscribeKey_RNA *key; const char *none = ""; - CLOG_INFO(WM_LOG_MSGBUS_PUB, - 2, - "rna(id='%s', %s.%s)", - msg_key_params->ptr.owner_id ? ((ID *)msg_key_params->ptr.owner_id)->name : none, - msg_key_params->ptr.type ? RNA_struct_identifier(msg_key_params->ptr.type) : none, - msg_key_params->prop ? RNA_property_identifier((PropertyRNA *)msg_key_params->prop) : - none); + CLOG_DEBUG(WM_LOG_MSGBUS_PUB, + "rna(id='%s', %s.%s)", + msg_key_params->ptr.owner_id ? ((ID *)msg_key_params->ptr.owner_id)->name : none, + msg_key_params->ptr.type ? RNA_struct_identifier(msg_key_params->ptr.type) : none, + msg_key_params->prop ? RNA_property_identifier((PropertyRNA *)msg_key_params->prop) : + none); if ((key = WM_msg_lookup_rna(mbus, msg_key_params))) { WM_msg_publish_with_key(mbus, &key->head); @@ -305,14 +304,13 @@ void WM_msg_subscribe_rna_params(wmMsgBus *mbus, msg_key_test.msg.params = *msg_key_params; const char *none = ""; - CLOG_INFO(WM_LOG_MSGBUS_SUB, - 3, - "rna(id='%s', %s.%s, info='%s')", - msg_key_params->ptr.owner_id ? ((ID *)msg_key_params->ptr.owner_id)->name : none, - msg_key_params->ptr.type ? RNA_struct_identifier(msg_key_params->ptr.type) : none, - msg_key_params->prop ? RNA_property_identifier((PropertyRNA *)msg_key_params->prop) : - none, - id_repr); + CLOG_TRACE(WM_LOG_MSGBUS_SUB, + "rna(id='%s', %s.%s, info='%s')", + msg_key_params->ptr.owner_id ? ((ID *)msg_key_params->ptr.owner_id)->name : none, + msg_key_params->ptr.type ? RNA_struct_identifier(msg_key_params->ptr.type) : none, + msg_key_params->prop ? RNA_property_identifier((PropertyRNA *)msg_key_params->prop) : + none, + id_repr); wmMsgSubscribeKey_RNA *msg_key = (wmMsgSubscribeKey_RNA *)WM_msg_subscribe_with_key( mbus, &msg_key_test.head, msg_val_params); diff --git a/source/blender/windowmanager/message_bus/intern/wm_message_bus_static.cc b/source/blender/windowmanager/message_bus/intern/wm_message_bus_static.cc index 3f1799c51f8..673526ce9bf 100644 --- a/source/blender/windowmanager/message_bus/intern/wm_message_bus_static.cc +++ b/source/blender/windowmanager/message_bus/intern/wm_message_bus_static.cc @@ -90,7 +90,7 @@ wmMsgSubscribeKey_Static *WM_msg_lookup_static(wmMsgBus *mbus, void WM_msg_publish_static_params(wmMsgBus *mbus, const wmMsgParams_Static *msg_key_params) { - CLOG_INFO(WM_LOG_MSGBUS_PUB, 2, "static(event=%d)", msg_key_params->event); + CLOG_DEBUG(WM_LOG_MSGBUS_PUB, "static(event=%d)", msg_key_params->event); wmMsgSubscribeKey_Static *key = WM_msg_lookup_static(mbus, msg_key_params); if (key) { diff --git a/source/creator/creator_args.cc b/source/creator/creator_args.cc index 4ef4627da18..d892c4044fc 100644 --- a/source/creator/creator_args.cc +++ b/source/creator/creator_args.cc @@ -69,10 +69,6 @@ # include "libmv-capi.h" # endif -# ifdef WITH_CYCLES -# include "CCL_api.h" -# endif - # include "DEG_depsgraph.hh" # include "WM_types.hh" @@ -1154,9 +1150,10 @@ static const char arg_handle_log_level_set_doc[] = "\n" "\tfatal: Fatal errors only\n" "\terror: Errors only\n" - "\twarning: Warnings and errors\n" - "\tinfo: General information, warnings and errors\n" - "\tdebug: Verbose messages for developers"; + "\twarning: Warnings\n" + "\tinfo: Information about devices, files, configuration, operations\n" + "\tdebug: Verbose messages for developers\n" + "\ttrace: Very verbose code execution tracing"; static int arg_handle_log_level_set(int argc, const char **argv, void * /*data*/) { const char *arg_id = "--log-level"; @@ -1164,34 +1161,38 @@ static int arg_handle_log_level_set(int argc, const char **argv, void * /*data*/ const char *err_msg = nullptr; if (STRCASEEQ(argv[1], "fatal")) { - /* TODO */ - G.log.level = 1; + G.log.level = CLG_LEVEL_FATAL; } else if (STRCASEEQ(argv[1], "error")) { - /* TODO */ - G.log.level = 1; + G.log.level = CLG_LEVEL_ERROR; } else if (STRCASEEQ(argv[1], "warning")) { - /* TODO */ - G.log.level = 1; + G.log.level = CLG_LEVEL_WARN; } else if (STRCASEEQ(argv[1], "info")) { - G.log.level = 1; + G.log.level = CLG_LEVEL_INFO; } else if (STRCASEEQ(argv[1], "debug")) { - G.log.level = 5; + G.log.level = CLG_LEVEL_DEBUG; + } + else if (STRCASEEQ(argv[1], "trace")) { + G.log.level = CLG_LEVEL_TRACE; } else if (parse_int_clamp(argv[1], nullptr, -1, INT_MAX, &G.log.level, &err_msg)) { - if (G.log.level == -1) { + /* Numeric level for backwards compatibility. */ + if (G.log.level < 0) { G.log.level = INT_MAX; } + else { + G.log.level = std::min(CLG_LEVEL_INFO + G.log.level, CLG_LEVEL_LEN - 1); + } } else { - fprintf(stderr, "\nError: %s '%s %s'.\n", err_msg, arg_id, argv[1]); + fprintf(stderr, "\nError: Invalid log level '%s %s'.\n", arg_id, argv[1]); return 1; } - CLG_level_set(G.log.level); + CLG_level_set(CLG_Level(G.log.level)); return 1; } fprintf(stderr, "\nError: '%s' no args given.\n", arg_id);