|
15 | 15 | #endif |
16 | 16 |
|
17 | 17 | #include <cstdio> // printf |
| 18 | +#include <ctime> // std::localtime |
18 | 19 | #include <iostream> |
19 | 20 | #include <iterator> // std::back_inserter |
20 | 21 |
|
@@ -171,11 +172,11 @@ Logger::Logger(Severity severity, Verbosity verbosity, std::string_view file, st |
171 | 172 | break; |
172 | 173 | case VSpec::Info::timestamp_us: |
173 | 174 | FillTimeInfos(); |
174 | | - fmt::format_to(std::back_inserter(fBWPrefix), "[{:%H:%M:%S}.{:06}]", fmt::localtime(fInfos.timestamp), fInfos.us.count()); |
| 175 | + fmt::format_to(std::back_inserter(fBWPrefix), "[{:%H:%M:%S}.{:06}]", *std::localtime(&fInfos.timestamp), fInfos.us.count()); |
175 | 176 | break; |
176 | 177 | case VSpec::Info::timestamp_s: |
177 | 178 | FillTimeInfos(); |
178 | | - fmt::format_to(std::back_inserter(fBWPrefix), "[{:%H:%M:%S}]", fmt::localtime(fInfos.timestamp)); |
| 179 | + fmt::format_to(std::back_inserter(fBWPrefix), "[{:%H:%M:%S}]", *std::localtime(&fInfos.timestamp)); |
179 | 180 | break; |
180 | 181 | case VSpec::Info::severity: |
181 | 182 | fmt::format_to(std::back_inserter(fBWPrefix), "[{}]", fInfos.severity_name); |
@@ -207,11 +208,11 @@ Logger::Logger(Severity severity, Verbosity verbosity, std::string_view file, st |
207 | 208 | break; |
208 | 209 | case VSpec::Info::timestamp_us: |
209 | 210 | FillTimeInfos(); |
210 | | - fmt::format_to(std::back_inserter(fColorPrefix), "[{}{:%H:%M:%S}.{:06}{}]", startColor(Color::fgCyan), fmt::localtime(fInfos.timestamp), fInfos.us.count(), endColor()); |
| 211 | + fmt::format_to(std::back_inserter(fColorPrefix), "[{}{:%H:%M:%S}.{:06}{}]", startColor(Color::fgCyan), *std::localtime(&fInfos.timestamp), fInfos.us.count(), endColor()); |
211 | 212 | break; |
212 | 213 | case VSpec::Info::timestamp_s: |
213 | 214 | FillTimeInfos(); |
214 | | - fmt::format_to(std::back_inserter(fColorPrefix), "[{}{:%H:%M:%S}{}]", startColor(Color::fgCyan), fmt::localtime(fInfos.timestamp), endColor()); |
| 215 | + fmt::format_to(std::back_inserter(fColorPrefix), "[{}{:%H:%M:%S}{}]", startColor(Color::fgCyan), *std::localtime(&fInfos.timestamp), endColor()); |
215 | 216 | break; |
216 | 217 | case VSpec::Info::severity: |
217 | 218 | fmt::format_to(std::back_inserter(fColorPrefix), "[{}]", GetColoredSeverityString(fInfos.severity)); |
|
0 commit comments