numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
log_formatter_base.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 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 <string_view>
23
24#include <fmt/format.h>
25
29
31
36public:
47 virtual void format(fmt::memory_buffer& buffer, time_stamp time,
48 std::string_view tag, log_level level, util::source_info_view source,
49 std::string_view body) = 0;
50
52 virtual ~log_formatter_base() = default;
53
56 auto operator=(const log_formatter_base&) = delete;
57 auto operator=(log_formatter_base&&) = delete;
58
59protected:
61 log_formatter_base() = default;
62};
63
64} // namespace num_collect::logging::formatters
virtual void format(fmt::memory_buffer &buffer, time_stamp time, std::string_view tag, log_level level, util::source_info_view source, std::string_view body)=0
Format a log.
Class of time stamps.
Definition time_stamp.h:38
Class to hold information of source codes.
Definition of log_level enumeration.
log_level
Enumeration of log levels.
Definition log_level.h:47
Definition of source_info_view class.
Definition of time_stamp class.