cpp-msgpack-rpc
0.2.0
An RPC library implementing MessagePack RPC.
Toggle main menu visibility
Loading...
Searching...
No Matches
log_sinks.h
Go to the documentation of this file.
1
/*
2
* Copyright 2023 MusicScience37 (Kenta Kabashima)
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
20
#pragma once
21
22
#include <cstddef>
23
#include <memory>
24
#include <string_view>
25
26
#include "
msgpack_rpc/config/logging_config.h
"
27
#include "msgpack_rpc/impl/msgpack_rpc_export.h"
28
#include "
msgpack_rpc/logging/i_log_sink.h
"
29
30
namespace
msgpack_rpc::logging
{
31
37
[[nodiscard]] MSGPACK_RPC_EXPORT std::shared_ptr<ILogSink>
38
create_stdout_log_sink
();
39
48
[[nodiscard]] MSGPACK_RPC_EXPORT std::shared_ptr<ILogSink>
49
create_rotating_file_log_sink
(std::string_view file_path,
50
std::size_t max_file_size, std::size_t max_files);
51
58
[[nodiscard]] MSGPACK_RPC_EXPORT std::shared_ptr<ILogSink>
59
create_log_sink_from_config
(
const
config::LoggingConfig& config);
60
61
}
// namespace msgpack_rpc::logging
i_log_sink.h
Definition of ILogSink class.
logging_config.h
Definition of LoggingConfig class.
msgpack_rpc::logging
Namespace of logging.
Definition
i_log_sink.h:27
msgpack_rpc::logging::create_rotating_file_log_sink
std::shared_ptr< ILogSink > create_rotating_file_log_sink(std::string_view file_path, std::size_t max_file_size, std::size_t max_files)
Create a log sink to write to a file with rotation.
Definition
log_sinks.cpp:55
msgpack_rpc::logging::create_stdout_log_sink
std::shared_ptr< ILogSink > create_stdout_log_sink()
Create a log sink to write to standard output.
Definition
log_sinks.cpp:50
msgpack_rpc::logging::create_log_sink_from_config
std::shared_ptr< ILogSink > create_log_sink_from_config(const config::LoggingConfig &config)
Create a log sink from a configuration.
Definition
log_sinks.cpp:66
include
msgpack_rpc
logging
log_sinks.h
Generated on
for cpp-msgpack-rpc by
1.18.0