Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
fml
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 (kLogInfo).
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.
25
LogSeverity
min_log_level
=
kLogInfo
;
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.
32
LogSettings
GetLogSettings
();
33
34
// Gets the minimum log level for the current process. Never returs a value
35
// higher than kLogFatal.
36
int
GetMinLogLevel
();
37
38
class
ScopedSetLogSettings
{
39
public
:
40
explicit
ScopedSetLogSettings
(
const
LogSettings
& settings);
41
~ScopedSetLogSettings
();
42
43
private
:
44
LogSettings
old_settings_;
45
};
46
47
}
// namespace fml
48
49
#endif
// FLUTTER_FML_LOG_SETTINGS_H_
fml::ScopedSetLogSettings
Definition
log_settings.h:38
fml::ScopedSetLogSettings::~ScopedSetLogSettings
~ScopedSetLogSettings()
Definition
log_settings.cc:45
fml
Definition
ascii_trie.cc:9
fml::LogSeverity
int LogSeverity
Definition
log_level.h:11
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
fml::kLogInfo
constexpr LogSeverity kLogInfo
Definition
log_level.h:13
fml::LogSettings
Definition
log_settings.h:15
fml::LogSettings::min_log_level
LogSeverity min_log_level
Definition
log_settings.h:25
Generated on Fri Apr 26 2024 06:14:05 for Flutter Engine by
1.9.8