Index: system_logging.h |
diff --git a/system_logging.h b/system_logging.h |
index 7ebfc5e5934c3f6e90910a15cd88b11e9399be7f..65b1ff418d145b96d8fa796808f2fb37181c7119 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,11 @@ 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_accumulator(std::string *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 +27,14 @@ 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_accumulator(std::string *accumulator) { |
+ accumulator_ = accumulator; |
+ } |
private: |
static std::string identity_; |
+ static std::string *accumulator_; |
+ void LogWithLevel(int level, const char *format, |
+ va_list arg_list); |
}; |
#endif // CRASH_REPORTER_SYSTEM_LOGGING_H_ |