userver: userver/logging/logger.hpp Source File
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
13USERVER_NAMESPACE_BEGIN
14
15namespace logging {
16
17namespace impl {
18
19class LoggerBase;
20void 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
27LoggerPtr MakeStderrLogger(const std::string& name, Format format,
28 Level level = Level::kInfo);
29
30/// @brief Creates synchronous stdout logger with default tskv pattern
31/// @param name logger name, for internal use, must be unique
32/// @see components::Logging
33LoggerPtr MakeStdoutLogger(const std::string& name, Format format,
34 Level level = Level::kInfo);
35
36/// @brief Creates synchronous file logger with default tskv pattern
37/// @param name logger name, for internal use, must be unique
38/// @param path target log file path
39/// @see components::Logging
40LoggerPtr MakeFileLogger(const std::string& name, const std::string& path,
41 Format format, Level level = Level::kInfo);
42
43} // namespace logging
44
45USERVER_NAMESPACE_END