clang-format
This commit is contained in:
		
							parent
							
								
									baa978ab0b
								
							
						
					
					
						commit
						a7ba6e447d
					
				@ -205,7 +205,6 @@ SPDLOG_INLINE bool logger::should_flush_(const details::log_msg &msg)
 | 
			
		||||
    return (msg.level >= flush_level) && (msg.level != level::off);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
SPDLOG_INLINE void logger::err_handler_(const std::string &msg)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -222,7 +221,7 @@ SPDLOG_INLINE void logger::err_handler_(const std::string &msg)
 | 
			
		||||
        std::lock_guard<std::mutex> lk{mutex};
 | 
			
		||||
        auto now = system_clock::now();
 | 
			
		||||
        err_counter++;
 | 
			
		||||
        if(now - last_report_time < std::chrono::seconds(1))
 | 
			
		||||
        if (now - last_report_time < std::chrono::seconds(1))
 | 
			
		||||
        {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -25,8 +25,14 @@
 | 
			
		||||
#include <vector>
 | 
			
		||||
 | 
			
		||||
#define SPDLOG_LOGGER_CATCH()                                                                                                              \
 | 
			
		||||
catch (const std::exception &ex) { err_handler_(ex.what());} \
 | 
			
		||||
catch (...) {err_handler_("Unknown exception in logger");}
 | 
			
		||||
    catch (const std::exception &ex)                                                                                                       \
 | 
			
		||||
    {                                                                                                                                      \
 | 
			
		||||
        err_handler_(ex.what());                                                                                                           \
 | 
			
		||||
    }                                                                                                                                      \
 | 
			
		||||
    catch (...)                                                                                                                            \
 | 
			
		||||
    {                                                                                                                                      \
 | 
			
		||||
        err_handler_("Unknown exception in logger");                                                                                       \
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
namespace spdlog {
 | 
			
		||||
class logger
 | 
			
		||||
 | 
			
		||||
@ -71,8 +71,6 @@ std::shared_ptr<logger> stderr_logger_st(const std::string &logger_name);
 | 
			
		||||
 | 
			
		||||
} // namespace spdlog
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef SPDLOG_HEADER_ONLY
 | 
			
		||||
#include "stdout_sinks-inl.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@ -150,7 +150,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::write_to_file_(const fmt::memory
 | 
			
		||||
    do
 | 
			
		||||
    {
 | 
			
		||||
        DWORD bytes_written = 0;
 | 
			
		||||
        bool ok = ::WriteFile(out_handle_, formatted.data()+total_written, size-total_written, &bytes_written, nullptr) != 0;
 | 
			
		||||
        bool ok = ::WriteFile(out_handle_, formatted.data() + total_written, size - total_written, &bytes_written, nullptr) != 0;
 | 
			
		||||
        if (!ok || bytes_written == 0)
 | 
			
		||||
        {
 | 
			
		||||
            throw spdlog_ex("wincolor_sink: write_to_file_ failed. GetLastError(): " + std::to_string(::GetLastError()));
 | 
			
		||||
 | 
			
		||||
@ -80,8 +80,6 @@ template std::shared_ptr<spdlog::logger> spdlog::stdout_color_st<spdlog::async_f
 | 
			
		||||
template std::shared_ptr<spdlog::logger> spdlog::stderr_color_mt<spdlog::async_factory>(const std::string &logger_name, color_mode mode);
 | 
			
		||||
template std::shared_ptr<spdlog::logger> spdlog::stderr_color_st<spdlog::async_factory>(const std::string &logger_name, color_mode mode);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#include "spdlog/sinks/stdout_sinks-inl.h"
 | 
			
		||||
 | 
			
		||||
template class spdlog::sinks::stdout_sink_base<spdlog::details::console_mutex>;
 | 
			
		||||
@ -101,7 +99,6 @@ template std::shared_ptr<spdlog::logger> spdlog::stdout_logger_st<spdlog::async_
 | 
			
		||||
template std::shared_ptr<spdlog::logger> spdlog::stderr_logger_mt<spdlog::async_factory>(const std::string &logger_name);
 | 
			
		||||
template std::shared_ptr<spdlog::logger> spdlog::stderr_logger_st<spdlog::async_factory>(const std::string &logger_name);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Slightly modified version of fmt lib's format.cc source file.
 | 
			
		||||
// Copyright (c) 2012 - 2016, Victor Zverovich
 | 
			
		||||
// All rights reserved.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user