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/app/cycles_standalone.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/app/cycles_standalone.cpp')
-rw-r--r-- | intern/cycles/app/cycles_standalone.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/intern/cycles/app/cycles_standalone.cpp b/intern/cycles/app/cycles_standalone.cpp index 1950e0b103f..ce3fb966b8c 100644 --- a/intern/cycles/app/cycles_standalone.cpp +++ b/intern/cycles/app/cycles_standalone.cpp @@ -25,6 +25,7 @@ #include "util_args.h" #include "util_foreach.h" #include "util_function.h" +#include "util_logging.h" #include "util_path.h" #include "util_progress.h" #include "util_string.h" @@ -331,7 +332,8 @@ static void options_parse(int argc, const char **argv) /* parse options */ ArgParse ap; - bool help = false; + bool help = false, debug = false; + int verbosity = 1; ap.options ("Usage: cycles [options] file.xml", "%*", files_parse, "", @@ -347,6 +349,10 @@ static void options_parse(int argc, const char **argv) "--width %d", &options.width, "Window width in pixel", "--height %d", &options.height, "Window height in pixel", "--list-devices", &list, "List information about all available devices", +#ifdef WITH_CYCLES_LOGGING + "--debug", &debug, "Enable debug logging", + "--verbose %d", &verbosity, "Set verbosity of the logger", +#endif "--help", &help, "Print help message", NULL); @@ -355,7 +361,13 @@ static void options_parse(int argc, const char **argv) ap.usage(); exit(EXIT_FAILURE); } - else if(list) { + + if (debug) { + util_logging_start(); + util_logging_verbosity_set(verbosity); + } + + if(list) { vector<DeviceInfo>& devices = Device::available_devices(); printf("Devices:\n"); @@ -435,6 +447,7 @@ using namespace ccl; int main(int argc, const char **argv) { + util_logging_init(argv[0]); path_init(); options_parse(argc, argv); |