// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #include #include #include namespace spdlog { namespace sinks { template basic_file_sink::basic_file_sink(const filename_t &filename, bool truncate, const file_event_handlers &event_handlers) : file_helper_{event_handlers} { file_helper_.open(filename, truncate); } template const filename_t &basic_file_sink::filename() const { return file_helper_.filename(); } template void basic_file_sink::sink_it_(const details::log_msg &msg) { memory_buf_t formatted; base_sink::formatter_->format(msg, formatted); file_helper_.write(formatted); } template void basic_file_sink::flush_() { file_helper_.flush(); } } // namespace sinks } // namespace spdlog // template instantiations template class SPDLOG_API spdlog::sinks::basic_file_sink; template class SPDLOG_API spdlog::sinks::basic_file_sink;