Blender V4.3
logging.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include <gflags/gflags.h>
6
7#include "intern/logging.h"
10
11static bool is_verbosity_set() {
12 using LIBMV_GFLAGS_NAMESPACE::GetCommandLineOption;
13
14 std::string verbosity;
15 if (!GetCommandLineOption("v", &verbosity)) {
16 return false;
17 }
18 return verbosity != "0";
19}
20
21void libmv_initLogging(const char* argv0) {
22 using LIBMV_GFLAGS_NAMESPACE::SetCommandLineOption;
23 google::InitGoogleLogging(argv0);
24 SetCommandLineOption("logtostderr", "1");
25 if (!is_verbosity_set()) {
26 SetCommandLineOption("v", "0");
27 }
28 SetCommandLineOption("stderrthreshold", "0");
29 SetCommandLineOption("minloglevel", "0");
30}
31
33 using LIBMV_GFLAGS_NAMESPACE::SetCommandLineOption;
34 SetCommandLineOption("logtostderr", "1");
35 if (!is_verbosity_set()) {
36 SetCommandLineOption("v", "2");
37 }
38 SetCommandLineOption("stderrthreshold", "0");
39 SetCommandLineOption("minloglevel", "0");
40}
41
42void libmv_setLoggingVerbosity(int verbosity) {
43 using LIBMV_GFLAGS_NAMESPACE::SetCommandLineOption;
44 char val[10];
45 snprintf(val, sizeof(val), "%d", verbosity);
46 SetCommandLineOption("v", val);
47}
void libmv_setLoggingVerbosity(int verbosity)
Definition logging.cc:42
void libmv_startDebugLogging(void)
Definition logging.cc:32
void libmv_initLogging(const char *argv0)
Definition logging.cc:21
static bool is_verbosity_set()
Definition logging.cc:11