ww3877989 / google-breakpad

Automatically exported from code.google.com/p/google-breakpad
0 stars 0 forks source link

Logging is not overrideable #539

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I attempted to redirect BP's logging to Chrome's by setting the 
"BP_LOGGING_INCLUDE" define to a file as so:
--- cut here ---
// Copyright 2013 Google Inc. All Rights Reserved.
#ifndef DUMPALYZER_BP_LOGGING_H_
#define DUMPALYZER_BP_LOGGING_H_

#include "base/logging.h"

#define BPLOG LOG

#endif  // DUMPALYZER_BP_LOGGING_H_
--- cut here ---

This results in compilation errors when the BPLOG_IF macro is expanded, as so:

1>..\breakpad\src\processor\minidump.cc(812): error C2679: binary '&' : no 
operator found which takes a right-hand operand of type 'bool' (or there is no 
acceptable conversion)
1>          C:\src\dumpalyzer\src\breakpad\src\processor/logging.h(130): could 
be 'void google_breakpad::LogMessageVoidify::operator 
&(base_logging::LogMessage &)'
1>          while trying to match the argument list 
'(google_breakpad::LogMessageVoidify, bool)'

It would probably be better to allow users to override that macro explicitly as 
well.

Original issue reported on code.google.com by siggi@chromium.org on 29 Jul 2013 at 2:19

GoogleCodeExporter commented 9 years ago
I didn't think you were supposed to override BPLOG directly, but instead 
override the individual streams, like:
http://code.google.com/p/google-breakpad/source/browse/trunk/src/client/mac/test
s/testlogging.h

I guess logging.h claims otherwise, though:
http://code.google.com/p/google-breakpad/source/browse/trunk/src/processor/loggi
ng.h#36

Original comment by ted.mielczarek on 29 Jul 2013 at 2:36