mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-30 02:19:35 +08:00
Bug fixes
This commit is contained in:
@@ -115,8 +115,9 @@ void c11log::logger::_variadic_log(c11log::details::line_logger& l, const First&
|
||||
|
||||
inline void c11log::logger::_log_msg(details::log_msg& msg)
|
||||
{
|
||||
//Use default formatter if not set
|
||||
if (!_formatter)
|
||||
_formatter = std::make_shared<pattern_formatter>("%+ %t");
|
||||
_formatter = std::make_shared<pattern_formatter>("%+");
|
||||
_formatter->format(msg);
|
||||
for (auto &sink : _sinks)
|
||||
sink->log(msg);
|
||||
|
@@ -93,7 +93,7 @@ constexpr inline unsigned short eol_size()
|
||||
#endif
|
||||
|
||||
//fopen_s on non windows for writing
|
||||
inline bool fopen_s(FILE** fp, const std::string& filename, const char* mode)
|
||||
inline int fopen_s(FILE** fp, const std::string& filename, const char* mode)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return ::fopen_s(fp, filename.c_str(), mode);
|
||||
|
@@ -366,11 +366,7 @@ class full_formatter :public flag_formatter
|
||||
auto millis = std::chrono::duration_cast<std::chrono::milliseconds>(duration).count() % 1000;
|
||||
msg.formatted.put_int(static_cast<int>(millis), 3);
|
||||
msg.formatted.putc(']');
|
||||
msg.formatted << " [";
|
||||
msg.formatted << msg.logger_name;
|
||||
msg.formatted << "] [";
|
||||
msg.formatted << level::to_str(msg.level);
|
||||
msg.formatted << "] ";
|
||||
msg.formatted << " [" << msg.logger_name << "] [" << level::to_str(msg.level) << "] ";
|
||||
msg.formatted.put_fast_oss(msg.raw);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user