When not writing to file in DM, spew verbose output to stderr
authoregdaniel <egdaniel@google.com>
Fri, 11 Mar 2016 15:14:49 +0000 (07:14 -0800)
committerCommit bot <commit-bot@chromium.org>
Fri, 11 Mar 2016 15:14:49 +0000 (07:14 -0800)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1788743002

Review URL: https://codereview.chromium.org/1788743002

dm/DM.cpp

index 2196e60..f70d19e 100644 (file)
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -1303,9 +1303,13 @@ int dm_main();
 int dm_main() {
     setup_crash_handler();
 
-    if (FLAGS_verbose && !FLAGS_writePath.isEmpty()) {
-        sk_mkdir(FLAGS_writePath[0]);
-        gVLog = freopen(SkOSPath::Join(FLAGS_writePath[0], "verbose.log").c_str(), "w", stderr);
+    if (FLAGS_verbose) {
+        if(!FLAGS_writePath.isEmpty()) {
+            sk_mkdir(FLAGS_writePath[0]);
+            gVLog = freopen(SkOSPath::Join(FLAGS_writePath[0], "verbose.log").c_str(), "w", stderr);
+        } else {
+            gVLog = stderr;
+        }
     }
 
     JsonWriter::DumpJson();  // It's handy for the bots to assume this is ~never missing.