Skip to content

Commit c740269

Browse files
committed
logging: Use ISO 8601 time format for logging
Switch locale-aware timestamping for logging / crash handling to %H:%M:%S
1 parent b150e87 commit c740269

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

frontend/OBSApp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ string CurrentDateTimeString()
278278
struct tm tstruct;
279279
char buf[80];
280280
tstruct = *localtime(&now);
281-
strftime(buf, sizeof(buf), "%Y-%m-%d, %X", &tstruct);
281+
strftime(buf, sizeof(buf), "%Y-%m-%d, %T", &tstruct);
282282
return buf;
283283
}
284284

@@ -873,7 +873,7 @@ static bool set_utf8_locale(void)
873873
*/
874874
usingUTF8 = usingUTF8 || !!setlocale(LC_ALL, "C.UTF-8");
875875
if (!usingUTF8)
876-
setlocale(LC_ALL, "C");
876+
setlocale(LC_ALL, "C");
877877

878878
// fix float handling
879879
setlocale(LC_NUMERIC, "C");
@@ -892,7 +892,7 @@ static bool set_utf8_locale(void)
892892
blog(LOG_INFO, "Set locale to: %s", defaultLocale.name().c_str());
893893

894894
return usingUTF8;
895-
}
895+
}
896896

897897
OBSApp::OBSApp(int &argc, char **argv, profiler_name_store_t *store)
898898
: QApplication(argc, argv),

libobs/obs-win-crash-handler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static inline void write_header(struct exception_handler_data *data)
245245
time_t now = time(0);
246246
struct tm ts;
247247
ts = *localtime(&now);
248-
strftime(date_time, sizeof(date_time), "%Y-%m-%d, %X", &ts);
248+
strftime(date_time, sizeof(date_time), "%Y-%m-%d, %T", &ts);
249249

250250
const char *obs_bitness;
251251
if (sizeof(void *) == 8)

0 commit comments

Comments
 (0)