userver
C++ Async Framework
Loading...
Searching...
No Matches
logger.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/logging/logger.hpp
4
/// @brief Logger definitions and helpers
5
6
#
include
<
memory
>
7
#
include
<
string
>
8
9
#
include
<
userver
/
logging
/
format
.
hpp
>
10
#
include
<
userver
/
logging
/
fwd
.
hpp
>
11
#
include
<
userver
/
logging
/
level
.
hpp
>
12
13
USERVER_NAMESPACE_BEGIN
14
15
namespace
logging
{
16
17
namespace
impl {
18
19
class
LoggerBase;
20
void
LogRaw(LoggerBase& logger,
Level
level, std::string_view message);
21
22
}
// namespace impl
23
24
/// @brief Creates synchronous stderr logger with default tskv pattern
25
/// @param name logger name, for internal use, must be unique
26
/// @see components::Logging
27
LoggerPtr
MakeStderrLogger
(
const
std::string& name,
Format
format,
Level
level =
Level
::kInfo);
28
29
/// @brief Creates synchronous stdout logger with default tskv pattern
30
/// @param name logger name, for internal use, must be unique
31
/// @see components::Logging
32
LoggerPtr
MakeStdoutLogger
(
const
std::string& name,
Format
format,
Level
level =
Level
::kInfo);
33
34
/// @brief Creates synchronous file logger with default tskv pattern
35
/// @param name logger name, for internal use, must be unique
36
/// @param path target log file path
37
/// @see components::Logging
38
LoggerPtr
MakeFileLogger
(
const
std::string& name,
const
std::string& path,
Format
format,
Level
level =
Level
::kInfo);
39
40
namespace
impl {
41
class
TagWriter;
42
}
43
44
namespace
impl::default_ {
45
46
bool
DoShouldLog(
Level
)
noexcept
;
47
48
void
PrependCommonTags(TagWriter writer);
49
50
}
// namespace impl::default_
51
52
}
// namespace logging
53
54
USERVER_NAMESPACE_END
userver
logging
logger.hpp
Generated on Tue Nov 19 2024 11:28:35 for userver by
Doxygen
1.10.0