诸暨麻将添加redis
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

44 lines
1020 B

  1. // Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
  2. // Distributed under the MIT License (http://opensource.org/licenses/MIT)
  3. #pragma once
  4. #ifndef SPDLOG_HEADER_ONLY
  5. #include <spdlog/sinks/basic_file_sink.h>
  6. #endif
  7. #include <spdlog/common.h>
  8. #include <spdlog/details/os.h>
  9. namespace spdlog {
  10. namespace sinks {
  11. template<typename Mutex>
  12. SPDLOG_INLINE basic_file_sink<Mutex>::basic_file_sink(const filename_t &filename, bool truncate)
  13. {
  14. file_helper_.open(filename, truncate);
  15. }
  16. template<typename Mutex>
  17. SPDLOG_INLINE const filename_t &basic_file_sink<Mutex>::filename() const
  18. {
  19. return file_helper_.filename();
  20. }
  21. template<typename Mutex>
  22. SPDLOG_INLINE void basic_file_sink<Mutex>::sink_it_(const details::log_msg &msg)
  23. {
  24. memory_buf_t formatted;
  25. base_sink<Mutex>::formatter_->format(msg, formatted);
  26. file_helper_.write(formatted);
  27. }
  28. template<typename Mutex>
  29. SPDLOG_INLINE void basic_file_sink<Mutex>::flush_()
  30. {
  31. file_helper_.flush();
  32. }
  33. } // namespace sinks
  34. } // namespace spdlog