Flutter Engine
log_settings.cc
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 #include "flutter/fml/log_settings.h"
6 
7 #include <fcntl.h>
8 
9 #include <algorithm>
10 #include <cstring>
11 #include <iostream>
12 
13 #include "flutter/fml/logging.h"
14 
15 namespace fml {
16 namespace state {
17 
18 // Defined in log_settings_state.cc.
20 
21 } // namespace state
22 
23 void SetLogSettings(const LogSettings& settings) {
24  // Validate the new settings as we set them.
26  std::min(LOG_FATAL, settings.min_log_level);
27 }
28 
30  return state::g_log_settings;
31 }
32 
34  return std::min(state::g_log_settings.min_log_level, LOG_FATAL);
35 }
36 
38  old_settings_ = GetLogSettings();
39  SetLogSettings(settings);
40 }
41 
43  SetLogSettings(old_settings_);
44 }
45 
46 } // namespace fml
void SetLogSettings(const LogSettings &settings)
Definition: log_settings.cc:23
int GetMinLogLevel()
Definition: log_settings.cc:33
Definition: ascii_trie.cc:9
LogSettings g_log_settings
LogSeverity min_log_level
Definition: log_settings.h:25
LogSettings GetLogSettings()
Definition: log_settings.cc:29
ScopedSetLogSettings(const LogSettings &settings)
Definition: log_settings.cc:37
constexpr LogSeverity LOG_FATAL
Definition: log_level.h:16