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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « crash_reporter_logs.conf ('k') | system_logging.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CRASH_REPORTER_SYSTEM_LOGGING_H_ 5 #ifndef CRASH_REPORTER_SYSTEM_LOGGING_H_
6 #define CRASH_REPORTER_SYSTEM_LOGGING_H_ 6 #define CRASH_REPORTER_SYSTEM_LOGGING_H_
7 7
8 #include <stdarg.h>
8 #include <string> 9 #include <string>
9 10
10 class SystemLogging { 11 class SystemLogging {
11 public: 12 public:
12 virtual void Initialize(const char *ident) = 0; 13 virtual void Initialize(const char *ident) = 0;
13 virtual void LogInfo(const char *format, ...) = 0; 14 virtual void LogInfo(const char *format, ...) = 0;
14 virtual void LogWarning(const char *format, ...) = 0; 15 virtual void LogWarning(const char *format, ...) = 0;
15 virtual void LogError(const char *format, ...) = 0; 16 virtual void LogError(const char *format, ...) = 0;
17 virtual void set_accumulating(bool value) = 0;
18 virtual std::string get_accumulator() = 0;
16 }; 19 };
17 20
21 // SystemLoggingImpl implements SystemLogging but adds the
22 // capability of accumulating the log to a STL string.
18 class SystemLoggingImpl : public SystemLogging { 23 class SystemLoggingImpl : public SystemLogging {
19 public: 24 public:
20 SystemLoggingImpl(); 25 SystemLoggingImpl();
21 virtual ~SystemLoggingImpl(); 26 virtual ~SystemLoggingImpl();
22 virtual void Initialize(const char *ident); 27 virtual void Initialize(const char *ident);
23 virtual void LogInfo(const char *format, ...); 28 virtual void LogInfo(const char *format, ...);
24 virtual void LogWarning(const char *format, ...); 29 virtual void LogWarning(const char *format, ...);
25 virtual void LogError(const char *format, ...); 30 virtual void LogError(const char *format, ...);
31 virtual void set_accumulating(bool value) {
32 is_accumulating_ = value;
33 }
34 virtual std::string get_accumulator() {
35 return accumulator_;
36 }
26 private: 37 private:
27 static std::string identity_; 38 static std::string identity_;
39 std::string accumulator_;
40 bool is_accumulating_;
41 void LogWithLevel(int level, const char *format,
42 va_list arg_list);
28 }; 43 };
29 44
30 #endif // CRASH_REPORTER_SYSTEM_LOGGING_H_ 45 #endif // CRASH_REPORTER_SYSTEM_LOGGING_H_
OLDNEW
« 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