cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
Loading...
Searching...
No Matches
logging_config.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 <string>
24#include <string_view>
25
26#include "msgpack_rpc/impl/msgpack_rpc_export.h"
28
29namespace msgpack_rpc::config {
30
34class MSGPACK_RPC_EXPORT LoggingConfig {
35public:
40
49 LoggingConfig& file_path(std::string_view value);
50
57 LoggingConfig& max_file_size(std::size_t value);
58
65 LoggingConfig& max_files(std::size_t value);
66
74
82 [[nodiscard]] std::string_view file_path() const noexcept;
83
89 [[nodiscard]] std::size_t max_file_size() const noexcept;
90
96 [[nodiscard]] std::size_t max_files() const noexcept;
97
103 [[nodiscard]] logging::LogLevel output_log_level() const noexcept;
104
105private:
107 std::string file_path_;
108
110 std::size_t max_file_size_;
111
113 std::size_t max_files_;
114
117};
118
119} // namespace msgpack_rpc::config
LoggingConfig & max_file_size(std::size_t value)
Set the maximum size of a file.
LoggingConfig & max_files(std::size_t value)
Set the maximum number of files.
std::size_t max_file_size_
Maximum size of a file.
LoggingConfig & output_log_level(logging::LogLevel value)
Set the log level to write logs.
std::size_t max_files_
Maximum number of files.
logging::LogLevel output_log_level_
Log level to write logs.
LoggingConfig & file_path(std::string_view value)
Set the file path.
Definition of LogLevel enumeration.
Namespace of configurations.
LogLevel
Enumeration of log levels.
Definition log_level.h:29