Index: dm/DMReporter.cpp |
diff --git a/dm/DMReporter.cpp b/dm/DMReporter.cpp |
index 0fd83e5bb656a1406cd6842a55185a4df8b96f45..1ff64c57cc5f56ded6207d0de5dcdfc27219b683 100644 |
--- a/dm/DMReporter.cpp |
+++ b/dm/DMReporter.cpp |
@@ -3,21 +3,27 @@ |
#include "SkCommandLineFlags.h" |
#include "OverwriteLine.h" |
-DEFINE_bool(quiet, false, "If true, don't print status updates."); |
+DEFINE_bool2(quiet, q, false, "If true, don't print status updates."); |
+DEFINE_bool2(verbose, v, false, "If true, print status updates one-per-line."); |
namespace DM { |
-void Reporter::updateStatusLine() const { |
+void Reporter::finish(SkString name) { |
+ sk_atomic_inc(&fFinished); |
+ |
if (FLAGS_quiet) { |
return; |
} |
SkString status; |
- status.printf("%s%d tasks left", kSkOverwriteLine, this->started() - this->finished()); |
+ status.printf("%s%d tasks left", |
+ FLAGS_verbose ? "\n" : kSkOverwriteLine, |
+ this->started() - this->finished()); |
const int failed = this->failed(); |
if (failed > 0) { |
status.appendf(", %d failed", failed); |
} |
+ status.appendf("\t[%s done]", name.c_str()); |
SkDebugf(status.c_str()); |
} |
@@ -26,9 +32,9 @@ int32_t Reporter::failed() const { |
return fFailures.count(); |
} |
-void Reporter::fail(SkString name) { |
+void Reporter::fail(SkString msg) { |
SkAutoMutexAcquire writer(&fMutex); |
- fFailures.push_back(name); |
+ fFailures.push_back(msg); |
} |
void Reporter::getFailures(SkTArray<SkString>* failures) const { |