Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(546)

Unified Diff: system_logging.h

Issue 6297004: crash-reporter: Add diagnostics to help diagnose failures in the wild (Closed) Base URL: http://git.chromium.org/git/crash-reporter.git@master
Patch Set: respond to review Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crash_reporter_logs.conf ('k') | system_logging.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: system_logging.h
diff --git a/system_logging.h b/system_logging.h
index 7ebfc5e5934c3f6e90910a15cd88b11e9399be7f..d1f72a56e6f51d06f62ed4ab70e8b7b32d0380c4 100644
--- a/system_logging.h
+++ b/system_logging.h
@@ -5,6 +5,7 @@
#ifndef CRASH_REPORTER_SYSTEM_LOGGING_H_
#define CRASH_REPORTER_SYSTEM_LOGGING_H_
+#include <stdarg.h>
#include <string>
class SystemLogging {
@@ -13,8 +14,12 @@ class SystemLogging {
virtual void LogInfo(const char *format, ...) = 0;
virtual void LogWarning(const char *format, ...) = 0;
virtual void LogError(const char *format, ...) = 0;
+ virtual void set_accumulating(bool value) = 0;
+ virtual std::string get_accumulator() = 0;
};
+// SystemLoggingImpl implements SystemLogging but adds the
+// capability of accumulating the log to a STL string.
class SystemLoggingImpl : public SystemLogging {
public:
SystemLoggingImpl();
@@ -23,8 +28,18 @@ class SystemLoggingImpl : public SystemLogging {
virtual void LogInfo(const char *format, ...);
virtual void LogWarning(const char *format, ...);
virtual void LogError(const char *format, ...);
+ virtual void set_accumulating(bool value) {
+ is_accumulating_ = value;
+ }
+ virtual std::string get_accumulator() {
+ return accumulator_;
+ }
private:
static std::string identity_;
+ std::string accumulator_;
+ bool is_accumulating_;
+ void LogWithLevel(int level, const char *format,
+ va_list arg_list);
};
#endif // CRASH_REPORTER_SYSTEM_LOGGING_H_
« no previous file with comments | « crash_reporter_logs.conf ('k') | system_logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698