• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include <string.h>
9 
10 #include <algorithm>
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.
19 extern LogSettings g_log_settings;
20 
21 }  // namespace state
22 
SetLogSettings(const LogSettings & settings)23 void SetLogSettings(const LogSettings& settings) {
24   // Validate the new settings as we set them.
25   state::g_log_settings.min_log_level =
26       std::min(LOG_FATAL, settings.min_log_level);
27 }
28 
GetLogSettings()29 LogSettings GetLogSettings() {
30   return state::g_log_settings;
31 }
32 
GetMinLogLevel()33 int GetMinLogLevel() {
34   return std::min(state::g_log_settings.min_log_level, LOG_FATAL);
35 }
36 
37 }  // namespace fml
38