Bug 1867190 - Add prefs for PHC probablities r=glandium
[gecko.git] / xpcom / base / LogModulePrefWatcher.h
blob92a2a3d5b71afa110af7bffa7b0222a38c7d898d
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef LogModulePrefWatcher_h
8 #define LogModulePrefWatcher_h
10 #include "nsIObserver.h"
12 namespace mozilla {
14 /**
15 * Watches for changes to "logging.*" prefs and then updates the appropriate
16 * LogModule's log level. Both the integer and string versions of the LogLevel
17 * enum are supported.
19 * For example setting the pref "logging.Foo" to "Verbose" will set the
20 * LogModule for "Foo" to the LogLevel::Verbose level. Setting "logging.Bar" to
21 * 4 would set the LogModule for "Bar" to the LogLevel::Debug level.
23 class LogModulePrefWatcher : public nsIObserver {
24 public:
25 NS_DECL_ISUPPORTS
26 NS_DECL_NSIOBSERVER
28 /**
29 * Starts observing logging pref changes.
31 static void RegisterPrefWatcher();
33 private:
34 LogModulePrefWatcher();
35 virtual ~LogModulePrefWatcher() = default;
37 } // namespace mozilla
39 #endif // LogModulePrefWatcher_h