blob: a4e75783d2066e55f14064573f8b5f8888c9aa03 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
diff --git a/simpleble/src/Logging.cpp b/simpleble/src/Logging.cpp
index 781b658..6b05e44 100644
--- a/simpleble/src/Logging.cpp
+++ b/simpleble/src/Logging.cpp
@@ -90,7 +90,11 @@ void Logger::log_default_stdout() {
void Logger::log_default_file() {
std::time_t t = std::time(nullptr);
+#if FMT_VERSION < 120000
std::string date_time_str = fmt::format("{:%Y-%m-%d_%H-%M-%S}", fmt::localtime(t));
+#else
+ std::string date_time_str = fmt::format("{:%Y-%m-%d_%H-%M-%S}", *std::localtime(&t));
+#endif
std::string filename = fmt::format("simpleble_{}", date_time_str);
log_default_file(filename);
}
|