From e13bf4b5f33bcae56f7f33afeaa666479e611eb3 Mon Sep 17 00:00:00 2001 From: WallK Date: Tue, 22 Oct 2024 08:34:53 +0300 Subject: [PATCH] Added real milliseconds to log timestamp (thanks, monkeyx), typing fixes --- tools/configurator/scripts/class_functions.gd | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/configurator/scripts/class_functions.gd b/tools/configurator/scripts/class_functions.gd index 6689c3eb..584c519a 100644 --- a/tools/configurator/scripts/class_functions.gd +++ b/tools/configurator/scripts/class_functions.gd @@ -119,12 +119,13 @@ func logger_godot(log_type: String, log_text: String) -> void: var log_header: String = " GD " - var datetime = Time.get_datetime_dict_from_system() - var msec = Time.get_ticks_msec() #very very fake ms, TODO + var datetime: Dictionary = Time.get_datetime_dict_from_system() + var unixtime: float = Time.get_unix_time_from_system() + var msec: int = (unixtime - floor(unixtime)) * 1000 # finally, real ms! Thanks, monkeyx var timestamp: String = "[%d-%02d-%02d %02d:%02d:%02d.%03d]" % [ datetime.year, datetime.month, datetime.day, - datetime.hour, datetime.minute, datetime.second, msec] # fake ms + datetime.hour, datetime.minute, datetime.second, msec] # real ms!! var log_line: String = timestamp + log_header