1 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 // Shared logging infrastructure across different binaries.
8 #ifndef _mozilla_LoggingCore_h
9 #define _mozilla_LoggingCore_h
11 #include "mozilla/Atomics.h"
12 #include "mozilla/Types.h"
15 // While not a 100% mapping to PR_LOG's numeric values, mozilla::LogLevel does
16 // maintain a direct mapping for the Disabled, Debug and Verbose levels.
18 // Mappings of LogLevel to PR_LOG's numeric values:
20 // +---------+------------------+-----------------+
21 // | Numeric | NSPR Logging | Mozilla Logging |
22 // +---------+------------------+-----------------+
23 // | 0 | PR_LOG_NONE | Disabled |
24 // | 1 | PR_LOG_ALWAYS | Error |
25 // | 2 | PR_LOG_ERROR | Warning |
26 // | 3 | PR_LOG_WARNING | Info |
27 // | 4 | PR_LOG_DEBUG | Debug |
28 // | 5 | PR_LOG_DEBUG + 1 | Verbose |
29 // +---------+------------------+-----------------+
41 * Safely converts an integer into a valid LogLevel.
43 MFBT_API LogLevel
ToLogLevel(int32_t aLevel
);
45 using AtomicLogLevel
= Atomic
<LogLevel
, Relaxed
>;
47 } // namespace mozilla
49 #endif /* _mozilla_LoggingCore_h */