diff --git a/example/bench.cpp b/example/bench.cpp index bf01a82d..862e26c4 100644 --- a/example/bench.cpp +++ b/example/bench.cpp @@ -17,8 +17,8 @@ int main(int argc, char* argv[]) { 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] %t"; + std::string pattern = "%z %B %d, %Y %H:%M:%S.%e **************[%n:%l] %t"; + //std::string pattern = " [%z] %t"; auto formatter = std::make_shared(pattern); logger cout_logger("bench", { std::make_shared() }); diff --git a/example/example.cpp b/example/example.cpp index 55b17ed8..d4b04b16 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -17,7 +17,7 @@ details::fast_oss f(const std::string& what) oss << what; return oss; } -int main_(int, char* []) +int main(int, char* []) { auto foss = f("test2"); diff --git a/include/c11log/details/fast_oss.h b/include/c11log/details/fast_oss.h index 0781bf63..f90a2a8c 100644 --- a/include/c11log/details/fast_oss.h +++ b/include/c11log/details/fast_oss.h @@ -149,9 +149,9 @@ public: _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) diff --git a/include/c11log/details/os.h b/include/c11log/details/os.h index 71a6c0c1..512adf54 100644 --- a/include/c11log/details/os.h +++ b/include/c11log/details/os.h @@ -42,7 +42,7 @@ inline std::tm gmtime(const std::time_t &time_tt) gmtime_s(&tm, &time_tt); #else std::tm tm; - lgmtime_r(&time_tt, &tm); + gmtime_r(&time_tt, &tm); #endif return tm; } diff --git a/include/c11log/details/pattern_formatter.h b/include/c11log/details/pattern_formatter.h index 2578b0fe..c096456d 100644 --- a/include/c11log/details/pattern_formatter.h +++ b/include/c11log/details/pattern_formatter.h @@ -225,7 +225,6 @@ class r_formatter :public flag_formatter { void format(details::log_msg& msg) override { - int hours = to12h(msg.tm_time); msg.formatted.put_int(to12h(msg.tm_time), 2); msg.formatted.putc(':'); msg.formatted.put_int(msg.tm_time.tm_min, 2);