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
26
#include "
num_collect/logging/log_level.h
"
27
#include "
num_collect/logging/time_stamp.h
"
28
#include "
num_collect/util/source_info_view.h
"
29
30
namespace
num_collect::logging::formatters
{
31
35
class
log_formatter_base
{
36
public
:
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
54
log_formatter_base
(
const
log_formatter_base
&) =
delete
;
55
log_formatter_base
(
log_formatter_base
&&) =
delete
;
56
auto
operator=(
const
log_formatter_base
&) =
delete
;
57
auto
operator=(
log_formatter_base
&&) =
delete
;
58
59
protected
:
61
log_formatter_base
() =
default
;
62
};
63
64
}
// namespace num_collect::logging::formatters
num_collect::logging::formatters::log_formatter_base
Base class of classes to format logs.
Definition
log_formatter_base.h:35
num_collect::logging::formatters::log_formatter_base::log_formatter_base
log_formatter_base()=default
Constructor.
num_collect::logging::formatters::log_formatter_base::~log_formatter_base
virtual ~log_formatter_base()=default
Destructor.
num_collect::logging::formatters::log_formatter_base::format
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.
num_collect::logging::time_stamp
Class of time stamps.
Definition
time_stamp.h:38
num_collect::util::source_info_view
Class to hold information of source codes.
Definition
source_info_view.h:35
log_level.h
Definition of log_level enumeration.
num_collect::logging::formatters
Namespace of formatters of logs.
Definition
colored_compact_log_formatter.h:36
num_collect::logging::log_level
log_level
Enumeration of log levels.
Definition
log_level.h:47
source_info_view.h
Definition of source_info_view class.
time_stamp.h
Definition of time_stamp class.
include
num_collect
logging
formatters
log_formatter_base.h
Generated on Sat Jan 18 2025 03:47:32 for numerical-collection-cpp by
1.12.0