spdlog
Loading...
Searching...
No Matches
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
8#endif
9
10#include <spdlog/common.h>
11#include <spdlog/details/os.h>
12
13namespace spdlog {
14namespace sinks {
15
16template<typename Mutex>
18{
19 file_helper_.open(filename, truncate);
20}
21
22template<typename Mutex>
24{
25 return file_helper_.filename();
26}
27
28template<typename Mutex>
30{
31 memory_buf_t formatted;
32 base_sink<Mutex>::formatter_->format(msg, formatted);
33 file_helper_.write(formatted);
34}
35
36template<typename Mutex>
38{
39 file_helper_.flush();
40}
41
42} // namespace sinks
43} // namespace spdlog
basic_file_sink(const filename_t &filename, bool truncate=false)
const filename_t & filename() const
void sink_it_(const details::log_msg &msg) override
#define SPDLOG_INLINE
Definition common.h:33
Definition async.h:25
fmt::basic_memory_buffer< char, 250 > memory_buf_t
Definition common.h:116