cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
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
27#include "msgpack_rpc/impl/msgpack_rpc_export.h"
29
30namespace msgpack_rpc::logging {
31
37[[nodiscard]] MSGPACK_RPC_EXPORT std::shared_ptr<ILogSink>
39
48[[nodiscard]] MSGPACK_RPC_EXPORT std::shared_ptr<ILogSink>
49create_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>
59create_log_sink_from_config(const config::LoggingConfig& config);
60
61} // namespace msgpack_rpc::logging
Definition of ILogSink class.
Definition of LoggingConfig class.
Namespace of logging.
Definition i_log_sink.h:27
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
std::shared_ptr< ILogSink > create_stdout_log_sink()
Create a log sink to write to standard output.
Definition log_sinks.cpp:50
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