commency
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#ifndef LOG_HPP
|
||||
#define LOG_HPP
|
||||
|
||||
#define log _log
|
||||
#define log _log // comment to disable logging
|
||||
|
||||
#ifdef log
|
||||
#include <zlib.h>
|
||||
@@ -50,9 +50,9 @@ inline void _log(LOG level, std::string_view tag, std::format_string<Args...> st
|
||||
if (logToFile) {
|
||||
auto now = std::chrono::system_clock::now();
|
||||
auto local = std::chrono::current_zone()->to_local(now);
|
||||
std::string msg = std::format("{:%x %H:%M:%S }", floor<std::chrono::milliseconds>(local)); // timestamp
|
||||
std::format_to(std::back_inserter(msg), pattern, color, tag, reset); // tag
|
||||
std::format_to(std::back_inserter(msg), str, std::forward<Args>(args)...); // actual log message
|
||||
std::string msg = std::format("{:%x %H:%M:%S }", floor<std::chrono::milliseconds>(local)); // timestamp
|
||||
std::format_to(std::back_inserter(msg), pattern, color, tag, reset); // tag
|
||||
std::format_to(std::back_inserter(msg), str, std::forward<Args>(args)...); // actual log message
|
||||
|
||||
std::scoped_lock lock (fmtx);
|
||||
gzFile file = gzopen("linuxSmartie.log.gz", "ab");
|
||||
|
||||
Reference in New Issue
Block a user