Agora
1.2.0
Agora project
basic_file_sink-inl.h
Go to the documentation of this file.
1
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
2
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
3
4
#pragma once
5
6
#ifndef SPDLOG_HEADER_ONLY
7
# include <
spdlog/sinks/basic_file_sink.h
>
8
#endif
9
10
#include <
spdlog/common.h
>
11
#include <
spdlog/details/os.h
>
12
13
namespace
spdlog
{
14
namespace
sinks {
15
16
template
<
typename
Mutex>
17
SPDLOG_INLINE
basic_file_sink<Mutex>::basic_file_sink
(
const
filename_t
&
filename
,
bool
truncate,
const
file_event_handlers
&event_handlers)
18
: file_helper_{event_handlers}
19
{
20
file_helper_.open(
filename
, truncate);
21
}
22
23
template
<
typename
Mutex>
24
SPDLOG_INLINE
const
filename_t
&
basic_file_sink<Mutex>::filename
()
const
25
{
26
return
file_helper_.filename();
27
}
28
29
template
<
typename
Mutex>
30
SPDLOG_INLINE
void
basic_file_sink<Mutex>::sink_it_
(
const
details::log_msg
&msg)
31
{
32
memory_buf_t
formatted;
33
base_sink<Mutex>::formatter_
->format(msg, formatted);
34
file_helper_.write(formatted);
35
}
36
37
template
<
typename
Mutex>
38
SPDLOG_INLINE
void
basic_file_sink<Mutex>::flush_
()
39
{
40
file_helper_.flush();
41
}
42
43
}
// namespace sinks
44
}
// namespace spdlog
spdlog::sinks::basic_file_sink::sink_it_
void sink_it_(const details::log_msg &msg) override
Definition:
basic_file_sink-inl.h:30
spdlog::file_event_handlers
Definition:
common.h:308
spdlog::sinks::basic_file_sink::basic_file_sink
basic_file_sink(const filename_t &filename, bool truncate=false, const file_event_handlers &event_handlers={})
Definition:
basic_file_sink-inl.h:17
filename
filename
Definition:
parse_all_dl.m:14
fmt::v8::basic_memory_buffer
Definition:
format.h:677
spdlog
Definition:
async.h:25
spdlog::sinks::base_sink
Definition:
base_sink.h:19
spdlog::sinks::basic_file_sink::flush_
void flush_() override
Definition:
basic_file_sink-inl.h:38
basic_file_sink.h
SPDLOG_INLINE
#define SPDLOG_INLINE
Definition:
common.h:42
os.h
spdlog::sinks::basic_file_sink::filename
const filename_t & filename() const
Definition:
basic_file_sink-inl.h:24
common.h
spdlog::details::log_msg
Definition:
log_msg.h:11
spdlog::filename_t
std::string filename_t
Definition:
common.h:122
third_party
spdlog
include
spdlog
sinks
basic_file_sink-inl.h
Generated by
1.8.17