This commit is contained in:
gabime 2014-10-19 18:11:16 +03:00
parent ca1286e764
commit e76a365bf1
5 changed files with 6 additions and 7 deletions

View File

@ -17,8 +17,8 @@ int main(int argc, char* argv[])
{ {
const unsigned int howmany = argc <= 1 ? 500000 : atoi(argv[1]); const unsigned int howmany = argc <= 1 ? 500000 : atoi(argv[1]);
//std::string pattern = "%B %d, %Y %H:%M:%S.%e **************[%n:%l] %t"; std::string pattern = "%z %B %d, %Y %H:%M:%S.%e **************[%n:%l] %t";
std::string pattern = " [%z] %t"; //std::string pattern = " [%z] %t";
auto formatter = std::make_shared<details::pattern_formatter>(pattern); auto formatter = std::make_shared<details::pattern_formatter>(pattern);
logger cout_logger("bench", { std::make_shared<sinks::stderr_sink_mt>() }); logger cout_logger("bench", { std::make_shared<sinks::stderr_sink_mt>() });

View File

@ -17,7 +17,7 @@ details::fast_oss f(const std::string& what)
oss << what; oss << what;
return oss; return oss;
} }
int main_(int, char* []) int main(int, char* [])
{ {
auto foss = f("test2"); auto foss = f("test2");

View File

@ -149,9 +149,9 @@ public:
_dev.sputn(s.data(), s.size()); _dev.sputn(s.data(), s.size());
} }
void put_data(const char* p, std::size_t size) void put_data(const char* p, std::size_t data_size)
{ {
_dev.sputn(p, size); _dev.sputn(p, data_size);
} }
void put_str(const std::string& s) void put_str(const std::string& s)

View File

@ -42,7 +42,7 @@ inline std::tm gmtime(const std::time_t &time_tt)
gmtime_s(&tm, &time_tt); gmtime_s(&tm, &time_tt);
#else #else
std::tm tm; std::tm tm;
lgmtime_r(&time_tt, &tm); gmtime_r(&time_tt, &tm);
#endif #endif
return tm; return tm;
} }

View File

@ -225,7 +225,6 @@ class r_formatter :public flag_formatter
{ {
void format(details::log_msg& msg) override void format(details::log_msg& msg) override
{ {
int hours = to12h(msg.tm_time);
msg.formatted.put_int(to12h(msg.tm_time), 2); msg.formatted.put_int(to12h(msg.tm_time), 2);
msg.formatted.putc(':'); msg.formatted.putc(':');
msg.formatted.put_int(msg.tm_time.tm_min, 2); msg.formatted.put_int(msg.tm_time.tm_min, 2);