mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-28 00:25:42 +00:00
Added real milliseconds to log timestamp (thanks, monkeyx), typing fixes
This commit is contained in:
parent
bba70ed690
commit
e13bf4b5f3
|
@ -119,12 +119,13 @@ func logger_godot(log_type: String, log_text: String) -> void:
|
||||||
|
|
||||||
var log_header: String = " GD "
|
var log_header: String = " GD "
|
||||||
|
|
||||||
var datetime = Time.get_datetime_dict_from_system()
|
var datetime: Dictionary = Time.get_datetime_dict_from_system()
|
||||||
var msec = Time.get_ticks_msec() #very very fake ms, TODO
|
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]" % [
|
var timestamp: String = "[%d-%02d-%02d %02d:%02d:%02d.%03d]" % [
|
||||||
datetime.year, datetime.month, datetime.day,
|
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
|
var log_line: String = timestamp + log_header
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue