Flutter Engine
The Flutter Engine
fml
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
#include <limits>
13
14
#include "flutter/fml/build_config.h"
15
#include "flutter/fml/log_level.h"
16
#include "flutter/fml/logging.h"
17
18
namespace
fml
{
19
namespace
state
{
20
21
// Defined in log_settings_state.cc.
22
extern
LogSettings
g_log_settings
;
23
24
}
// namespace state
25
26
void
SetLogSettings
(
const
LogSettings
&
settings
) {
27
// Validate the new settings as we set them.
28
state::g_log_settings
.
min_log_level
=
29
std::min
(
kLogFatal
,
settings
.min_log_level);
30
}
31
32
LogSettings
GetLogSettings
() {
33
return
state::g_log_settings
;
34
}
35
36
int
GetMinLogLevel
() {
37
return
std::min
(
state::g_log_settings
.min_log_level,
kLogFatal
);
38
}
39
40
ScopedSetLogSettings::ScopedSetLogSettings
(
const
LogSettings
&
settings
) {
41
old_settings_ =
GetLogSettings
();
42
SetLogSettings
(
settings
);
43
}
44
45
ScopedSetLogSettings::~ScopedSetLogSettings
() {
46
SetLogSettings
(old_settings_);
47
}
48
49
}
// namespace fml
fml::ScopedSetLogSettings::~ScopedSetLogSettings
~ScopedSetLogSettings()
Definition:
log_settings.cc:45
fml::ScopedSetLogSettings::ScopedSetLogSettings
ScopedSetLogSettings(const LogSettings &settings)
Definition:
log_settings.cc:40
state
AtkStateType state
Definition:
fl_accessible_node.cc:10
min
static float min(float r, float g, float b)
Definition:
hsl.cpp:48
fml::state::g_log_settings
LogSettings g_log_settings
Definition:
log_settings_state.cc:11
fml
Definition:
ascii_trie.cc:9
fml::kLogFatal
constexpr LogSeverity kLogFatal
Definition:
log_level.h:19
fml::GetLogSettings
LogSettings GetLogSettings()
Definition:
log_settings.cc:32
fml::GetMinLogLevel
int GetMinLogLevel()
Definition:
log_settings.cc:36
fml::SetLogSettings
void SetLogSettings(const LogSettings &settings)
Definition:
log_settings.cc:26
gn.compile_sksl_tests.settings
settings
Definition:
compile_sksl_tests.py:18
fml::LogSettings
Definition:
log_settings.h:15
fml::LogSettings::min_log_level
LogSeverity min_log_level
Definition:
log_settings.h:25
Generated on Sun Jun 23 2024 21:54:58 for Flutter Engine by
1.9.4