diff options
author | mmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2007-05-25 18:04:17 +0000 |
---|---|---|
committer | mmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2007-05-25 18:04:17 +0000 |
commit | 32b802dba3d49880a0414d066e71cdc20ab09901 (patch) | |
tree | 821d84849d6c3fc41b9c139ec927d35f2b31d835 /src/processor/logging.h | |
parent | Fix bustage introduced in [172] (diff) | |
download | breakpad-32b802dba3d49880a0414d066e71cdc20ab09901.tar.xz |
Provide for logging initialization routines (#179). r=bryner
http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/4b196ca0b6d7f9a6
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@177 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/logging.h')
-rw-r--r-- | src/processor/logging.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/processor/logging.h b/src/processor/logging.h index 03753575..40738836 100644 --- a/src/processor/logging.h +++ b/src/processor/logging.h @@ -46,6 +46,12 @@ // be specified by the BP_LOGGING_INCLUDE macro. If defined, this header // will #include the header specified by that macro. // +// If any initialization is needed before logging, it can be performed by +// a function called through the BPLOG_INIT macro. Each main function of +// an executable program in the Breakpad processor library calls +// BPLOG_INIT(&argc, &argv); before any logging can be performed; define +// BPLOG_INIT appropriately if initialization is required. +// // Author: Mark Mentovai #ifndef PROCESSOR_LOGGING_H__ @@ -114,6 +120,10 @@ int ErrnoString(std::string *error_string); } // namespace google_breakpad +#ifndef BPLOG_INIT +#define BPLOG_INIT(pargc, pargv) +#endif // BPLOG_INIT + #ifndef BPLOG #define BPLOG(severity) BPLOG_ ## severity #endif // BPLOG @@ -122,19 +132,22 @@ int ErrnoString(std::string *error_string); #ifndef BPLOG_INFO_STREAM #define BPLOG_INFO_STREAM std::clog #endif // BPLOG_INFO_STREAM -#define BPLOG_INFO LogStream(BPLOG_INFO_STREAM, LogStream::SEVERITY_INFO, \ - __FILE__, __LINE__) +#define BPLOG_INFO google_breakpad::LogStream(BPLOG_INFO_STREAM, \ + google_breakpad::LogStream::SEVERITY_INFO, \ + __FILE__, __LINE__) #endif // BPLOG_INFO #ifndef BPLOG_ERROR #ifndef BPLOG_ERROR_STREAM #define BPLOG_ERROR_STREAM std::cerr #endif // BPLOG_ERROR_STREAM -#define BPLOG_ERROR LogStream(BPLOG_ERROR_STREAM, LogStream::SEVERITY_ERROR, \ - __FILE__, __LINE__) +#define BPLOG_ERROR google_breakpad::LogStream(BPLOG_ERROR_STREAM, \ + google_breakpad::LogStream::SEVERITY_ERROR, \ + __FILE__, __LINE__) #endif // BPLOG_ERROR #define BPLOG_IF(severity, condition) \ - !(condition) ? (void) 0 : LogMessageVoidify() & BPLOG(severity) + !(condition) ? (void) 0 : \ + google_breakpad::LogMessageVoidify() & BPLOG(severity) #endif // PROCESSOR_LOGGING_H__ |