Bug fixes

This commit is contained in:
gabi
2014-10-26 01:52:37 +02:00
parent b94ca27ce4
commit e5f4790407
4 changed files with 8 additions and 11 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);
}