diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-11-15 23:12:19 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-12-31 23:31:07 +0300 |
commit | bbf12722edb7d1cfbbdedd6757275ff386211fe0 (patch) | |
tree | caf5c11413443ca2e0e3060fa65e413271ce2be1 /intern/cycles/blender/blender_logging.cpp | |
parent | f2665d52e220a7726f1ca84127a1d1fb8078f521 (diff) |
Cycles: Fully support WITH_CYCLES_LOGGING option
This commit generalizes logging module a little bit in making it possible to use
Glog logging in standalone Cycles repository.
Diffstat (limited to 'intern/cycles/blender/blender_logging.cpp')
-rw-r--r-- | intern/cycles/blender/blender_logging.cpp | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/intern/cycles/blender/blender_logging.cpp b/intern/cycles/blender/blender_logging.cpp index 24ec2b4aedd..f4f86929168 100644 --- a/intern/cycles/blender/blender_logging.cpp +++ b/intern/cycles/blender/blender_logging.cpp @@ -15,51 +15,19 @@ */ #include "CCL_api.h" - -#include <stdio.h> - #include "util_logging.h" -#ifdef _MSC_VER -# define snprintf _snprintf -#endif - void CCL_init_logging(const char *argv0) { -#ifdef WITH_CYCLES_LOGGING - /* Make it so FATAL messages are always print into console. */ - char severity_fatal[32]; - snprintf(severity_fatal, sizeof(severity_fatal), "%d", - google::GLOG_FATAL); - - google::InitGoogleLogging(argv0); - gflags::SetCommandLineOption("logtostderr", "1"); - gflags::SetCommandLineOption("v", "0"); - gflags::SetCommandLineOption("stderrthreshold", severity_fatal); - gflags::SetCommandLineOption("minloglevel", severity_fatal); -#else - (void) argv0; -#endif + ccl::util_logging_init(argv0); } void CCL_start_debug_logging(void) { -#ifdef WITH_CYCLES_LOGGING - gflags::SetCommandLineOption("logtostderr", "1"); - gflags::SetCommandLineOption("v", "2"); - gflags::SetCommandLineOption("stderrthreshold", "1"); - gflags::SetCommandLineOption("minloglevel", "0"); -#endif + ccl::util_logging_start(); } void CCL_logging_verbosity_set(int verbosity) { -#ifdef WITH_CYCLES_LOGGING - char val[10]; - snprintf(val, sizeof(val), "%d", verbosity); - - gflags::SetCommandLineOption("v", val); -#else - (void) verbosity; -#endif + ccl::util_logging_verbosity_set(verbosity); } |