Flutter Engine
log_settings.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_FML_LOG_SETTINGS_H_
6 #define FLUTTER_FML_LOG_SETTINGS_H_
7 
8 #include <string>
9 
10 #include "flutter/fml/log_level.h"
11 
12 namespace fml {
13 
14 // Settings which control the behavior of FML logging.
15 struct LogSettings {
16  // The minimum logging level.
17  // Anything at or above this level will be logged (if applicable).
18  // Anything below this level will be silently ignored.
19  //
20  // The log level defaults to 0 (LOG_INFO).
21  //
22  // Log messages for FML_VLOG(x) (from flutter/fml/logging.h) are logged
23  // at level -x, so setting the min log level to negative values enables
24  // verbose logging.
26 };
27 
28 // Gets the active log settings for the current process.
29 void SetLogSettings(const LogSettings& settings);
30 
31 // Sets the active log settings for the current process.
33 
34 // Gets the minimum log level for the current process. Never returs a value
35 // higher than LOG_FATAL.
36 int GetMinLogLevel();
37 
39  public:
40  ScopedSetLogSettings(const LogSettings& settings);
42 
43  private:
44  LogSettings old_settings_;
45 };
46 
47 } // namespace fml
48 
49 #endif // FLUTTER_FML_LOG_SETTINGS_H_
void SetLogSettings(const LogSettings &settings)
Definition: log_settings.cc:23
int GetMinLogLevel()
Definition: log_settings.cc:33
Definition: ascii_trie.cc:9
int LogSeverity
Definition: log_level.h:10
LogSeverity min_log_level
Definition: log_settings.h:25
constexpr LogSeverity LOG_INFO
Definition: log_level.h:13
LogSettings GetLogSettings()
Definition: log_settings.cc:29