mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-14 01:32:07 +08:00
Merge remote-tracking branch 'gabime/master'
This commit is contained in:
commit
8f3c4218ed
@ -6,7 +6,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../logger.h"
|
#include "../logger.h"
|
||||||
#include "../sinks/stdout_sinks.h"
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -345,13 +344,11 @@ inline void spdlog::logger::_default_err_handler(const std::string &msg)
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
_last_err_time = now;
|
||||||
auto tm_time = details::os::localtime(now);
|
auto tm_time = details::os::localtime(now);
|
||||||
char date_buf[100];
|
char date_buf[100];
|
||||||
std::strftime(date_buf, sizeof(date_buf), "%Y-%m-%d %H:%M:%S", &tm_time);
|
std::strftime(date_buf, sizeof(date_buf), "%Y-%m-%d %H:%M:%S", &tm_time);
|
||||||
details::log_msg err_msg;
|
fmt::print(stderr, "[*** LOG ERROR ***] [{}] [{}] {}\n", date_buf, name(), msg);
|
||||||
err_msg.formatted.write("[*** LOG ERROR ***] [{}] [{}] [{}]{}", name(), msg, date_buf, details::os::default_eol);
|
|
||||||
sinks::stderr_sink_mt::instance()->log(err_msg);
|
|
||||||
_last_err_time = now;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool spdlog::logger::_should_flush_on(const details::log_msg &msg)
|
inline bool spdlog::logger::_should_flush_on(const details::log_msg &msg)
|
||||||
|
@ -8,6 +8,7 @@ void prepare_logdir()
|
|||||||
system("del /F /Q logs\\*");
|
system("del /F /Q logs\\*");
|
||||||
#else
|
#else
|
||||||
auto rv = system("mkdir -p logs");
|
auto rv = system("mkdir -p logs");
|
||||||
|
(void)rv;
|
||||||
rv = system("rm -f logs/*");
|
rv = system("rm -f logs/*");
|
||||||
(void)rv;
|
(void)rv;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user