From 2c1bffa286b9551c0533081cb16f497058974b03 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 16 Jun 2022 19:39:13 +0200 Subject: Cleanup: add verbose logging category names instead of numbers And use them more consistently than before. --- intern/cycles/util/debug.cpp | 2 +- intern/cycles/util/log.h | 19 ++++++++++++++++--- intern/cycles/util/task.cpp | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) (limited to 'intern/cycles/util') diff --git a/intern/cycles/util/debug.cpp b/intern/cycles/util/debug.cpp index 65d108bb9d1..faa54a92c24 100644 --- a/intern/cycles/util/debug.cpp +++ b/intern/cycles/util/debug.cpp @@ -25,7 +25,7 @@ void DebugFlags::CPU::reset() do { \ flag = (getenv(env) == NULL); \ if (!flag) { \ - VLOG(1) << "Disabling " << STRINGIFY(flag) << " instruction set."; \ + VLOG_INFO << "Disabling " << STRINGIFY(flag) << " instruction set."; \ } \ } while (0) diff --git a/intern/cycles/util/log.h b/intern/cycles/util/log.h index b33c826d6f5..3780d03c0d1 100644 --- a/intern/cycles/util/log.h +++ b/intern/cycles/util/log.h @@ -69,9 +69,22 @@ class LogMessageVoidify { # define LOG_ASSERT(expression) LOG_SUPPRESS() #endif -#define VLOG_ONCE(level, flag) \ - if (!flag) \ - flag = true, VLOG(level) +/* Verbose logging categories. */ + +/* Warnings. */ +#define VLOG_WARNING VLOG(1) +/* Info about devices, scene contents and features used. */ +#define VLOG_INFO VLOG(2) +#define VLOG_INFO_IS_ON VLOG_IS_ON(2) +/* Work being performed and timing/memory stats about that work. */ +#define VLOG_WORK VLOG(3) +#define VLOG_WORK_IS_ON VLOG_IS_ON(3) +/* Detailed device timing stats. */ +#define VLOG_DEVICE_STATS VLOG(4) +#define VLOG_DEVICE_STATS_IS_ON VLOG_IS_ON(4) +/* Verbose debug messages. */ +#define VLOG_DEBUG VLOG(5) +#define VLOG_DEBUG_IS_ON VLOG_IS_ON(5) struct int2; struct float3; diff --git a/intern/cycles/util/task.cpp b/intern/cycles/util/task.cpp index 2edc82eb7c3..12f661f752d 100644 --- a/intern/cycles/util/task.cpp +++ b/intern/cycles/util/task.cpp @@ -70,7 +70,7 @@ void TaskScheduler::init(int num_threads) } if (num_threads > 0) { /* Automatic number of threads. */ - VLOG(1) << "Overriding number of TBB threads to " << num_threads << "."; + VLOG_INFO << "Overriding number of TBB threads to " << num_threads << "."; global_control = new tbb::global_control(tbb::global_control::max_allowed_parallelism, num_threads); active_num_threads = num_threads; -- cgit v1.2.3