Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-06-28 16:42:58 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-06-28 16:45:29 +0300
commit0511de99bb1174ded5c08825ff29881daa7317e2 (patch)
tree54d364f06c6c967ded3d9d91de1bfa596b282590 /intern
parent8401ee24ffe6242e8b7b1139352409bf3ad08fc0 (diff)
Fix non-working verbosity when set prior to --debug
Before this change doing something like `--verbose 10 --debug-cycles` did not properly set verbosity, only using those arguments in an other way around was leading to a correct verbosity level.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/util/util_logging.cpp20
-rw-r--r--intern/libmv/intern/logging.cc19
2 files changed, 34 insertions, 5 deletions
diff --git a/intern/cycles/util/util_logging.cpp b/intern/cycles/util/util_logging.cpp
index 4a5e7e6a9ea..783a372e59f 100644
--- a/intern/cycles/util/util_logging.cpp
+++ b/intern/cycles/util/util_logging.cpp
@@ -17,6 +17,7 @@
#include "util/util_logging.h"
#include "util/util_math.h"
+#include "util/util_string.h"
#include <stdio.h>
#ifdef _MSC_VER
@@ -25,6 +26,17 @@
CCL_NAMESPACE_BEGIN
+static bool is_verbosity_set()
+{
+ using CYCLES_GFLAGS_NAMESPACE::GetCommandLineOption;
+
+ std::string verbosity;
+ if (!GetCommandLineOption("v", &verbosity)) {
+ return false;
+ }
+ return verbosity != "0";
+}
+
void util_logging_init(const char *argv0)
{
#ifdef WITH_CYCLES_LOGGING
@@ -36,7 +48,9 @@ void util_logging_init(const char *argv0)
google::InitGoogleLogging(argv0);
SetCommandLineOption("logtostderr", "1");
- SetCommandLineOption("v", "0");
+ if (!is_verbosity_set()) {
+ SetCommandLineOption("v", "0");
+ }
SetCommandLineOption("stderrthreshold", severity_fatal);
SetCommandLineOption("minloglevel", severity_fatal);
#else
@@ -49,7 +63,9 @@ void util_logging_start()
#ifdef WITH_CYCLES_LOGGING
using CYCLES_GFLAGS_NAMESPACE::SetCommandLineOption;
SetCommandLineOption("logtostderr", "1");
- SetCommandLineOption("v", "2");
+ if (!is_verbosity_set()) {
+ SetCommandLineOption("v", "2");
+ }
SetCommandLineOption("stderrthreshold", "1");
SetCommandLineOption("minloglevel", "0");
#endif
diff --git a/intern/libmv/intern/logging.cc b/intern/libmv/intern/logging.cc
index 6be0ef44e42..350be29d4db 100644
--- a/intern/libmv/intern/logging.cc
+++ b/intern/libmv/intern/logging.cc
@@ -23,6 +23,16 @@
#include "intern/utildefines.h"
#include "libmv/logging/logging.h"
+static bool is_verbosity_set() {
+ using LIBMV_GFLAGS_NAMESPACE::GetCommandLineOption;
+
+ std::string verbosity;
+ if (!GetCommandLineOption("v", &verbosity)) {
+ return false;
+ }
+ return verbosity != "0";
+}
+
void libmv_initLogging(const char* argv0) {
using LIBMV_GFLAGS_NAMESPACE::SetCommandLineOption;
// Make it so ERROR messages are always print into console.
@@ -30,8 +40,9 @@ void libmv_initLogging(const char* argv0) {
snprintf(severity_fatal, sizeof(severity_fatal), "%d",
google::GLOG_ERROR);
google::InitGoogleLogging(argv0);
- SetCommandLineOption("logtostderr", "1");
- SetCommandLineOption("v", "0");
+ if (!is_verbosity_set()) {
+ SetCommandLineOption("v", "0");
+ }
SetCommandLineOption("stderrthreshold", severity_fatal);
SetCommandLineOption("minloglevel", severity_fatal);
}
@@ -39,7 +50,9 @@ void libmv_initLogging(const char* argv0) {
void libmv_startDebugLogging(void) {
using LIBMV_GFLAGS_NAMESPACE::SetCommandLineOption;
SetCommandLineOption("logtostderr", "1");
- SetCommandLineOption("v", "2");
+ if (!is_verbosity_set()) {
+ SetCommandLineOption("v", "2");
+ }
SetCommandLineOption("stderrthreshold", "1");
SetCommandLineOption("minloglevel", "0");
}