Skip to content

Commit

Permalink
Bug 1166964 - Disable Breakpad INFO logging. r=ted
Browse files Browse the repository at this point in the history
  • Loading branch information
jryans committed Jun 8, 2015
1 parent adc6a93 commit a4abf25
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 2 deletions.
16 changes: 16 additions & 0 deletions toolkit/crashreporter/breakpad-logging/BreakpadLogging.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "BreakpadLogging.h"

#include <ostream>

namespace mozilla {

// An output stream that acts like /dev/null and drops all output directed to it
// Passing 0 here causes the ostream to enter an error state, and so it silently
// drops all output directed to it.
std::ostream gNullStream(0);

} // namespace mozilla
20 changes: 20 additions & 0 deletions toolkit/crashreporter/breakpad-logging/BreakpadLogging.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef BreakpadLogging_h
#define BreakpadLogging_h

#include <ostream>

namespace mozilla {

// An output stream that acts like /dev/null and drops all output directed to it
extern std::ostream gNullStream;

} // namespace mozilla

// Override the breakpad info stream to disable INFO logs
#define BPLOG_INFO_STREAM mozilla::gNullStream

#endif // BreakpadLogging_h
18 changes: 18 additions & 0 deletions toolkit/crashreporter/breakpad-logging/moz.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

UNIFIED_SOURCES += [
'BreakpadLogging.cpp',
]

Library('breakpad_logging')

FINAL_LIBRARY = 'xul'

FAIL_ON_WARNINGS = True

with Files('**'):
BUG_COMPONENT = ('Toolkit', 'Breakpad Integration')
1 change: 1 addition & 0 deletions toolkit/crashreporter/client/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ elif CONFIG['OS_ARCH'] == 'Darwin':
OS_LIBS += ['-framework Cocoa']
USE_LIBS += [
'breakpad_common_s',
'breakpad_logging',
'breakpad_mac_common_s',
]
elif CONFIG['OS_ARCH'] == 'SunOS':
Expand Down
4 changes: 3 additions & 1 deletion toolkit/crashreporter/google-breakpad/src/common/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
if CONFIG['OS_TARGET'] == 'Android':
DEFINES['NO_STABS_SUPPORT'] = True

DEFINES['BP_LOGGING_INCLUDE'] = '"BreakpadLogging.h"'

include('/toolkit/crashreporter/crashreporter.mozbuild')

LOCAL_INCLUDES += [
'..',
'../../../breakpad-logging',
]

3 changes: 3 additions & 0 deletions toolkit/crashreporter/google-breakpad/src/processor/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ UNIFIED_SOURCES += [

FINAL_LIBRARY = 'xul'

DEFINES['BP_LOGGING_INCLUDE'] = '"BreakpadLogging.h"'

LOCAL_INCLUDES += [
'..',
'../..',
'../../../breakpad-logging',
]

include('/toolkit/crashreporter/crashreporter.mozbuild')
5 changes: 4 additions & 1 deletion toolkit/crashreporter/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ elif CONFIG['OS_ARCH'] == 'SunOS':
'google-breakpad/src/tools/solaris/dump_syms',
]

DIRS += ['client']
DIRS += [
'breakpad-logging',
'client',
]

if CONFIG['MOZ_CRASHREPORTER_INJECTOR']:
DIRS += ['injector']
Expand Down
1 change: 1 addition & 0 deletions toolkit/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ elif CONFIG['MOZ_ENABLE_PROFILER_SPS']:
# Profiler requires some crashreporter code,
# so build it even if crashreporter is disabled.
DIRS += [
'crashreporter/breakpad-logging',
'crashreporter/google-breakpad/src/common',
'crashreporter/google-breakpad/src/processor',
]
Expand Down

0 comments on commit a4abf25

Please sign in to comment.