Bug 1165515 - Part 2: Add MOZ_LOG_TEST. r=froydnj
☠☠ backed out by 3c8ed81098dd ☠ ☠
authorEric Rahm <erahm@mozilla.com>
Mon, 01 Jun 2015 22:17:17 -0700
changeset 246687 5fcf1203cc1d4c3b39c68941e9da9e47b950f40a
parent 246686 86dfea34550188de51931b4d9647c21788577a04
child 246688 ffa4eb6d24b94146df5838e10b039e8b176c8edb
push id28839
push userkwierso@gmail.com
push dateWed, 03 Jun 2015 01:20:15 +0000
treeherdermozilla-central@20a96e15631a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1165515
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1165515 - Part 2: Add MOZ_LOG_TEST. r=froydnj
xpcom/glue/Logging.h
--- a/xpcom/glue/Logging.h
+++ b/xpcom/glue/Logging.h
@@ -11,10 +11,15 @@
 
 // This file is a placeholder for a replacement to the NSPR logging framework
 // that is defined in prlog.h. Currently it is just a pass through, but as
 // work progresses more functionality will be swapped out in favor of
 // mozilla logging implementations.
 
 #define MOZ_LOG PR_LOG
 
+// Tests if a module has enabled the given log level.
+// NB: _module can be null.
+#define MOZ_LOG_TEST(_module, _level) \
+  ((_module) && (_module)->level >= (_level))
+
 #endif // mozilla_logging_h