Skip to content

Commit 6627ee8

Browse files
mod_log: preserve the original text instead of overwriting with the prefix
1 parent c1bcf6e commit 6627ee8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

loader/mod_loader.gd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func dev_log(text:String, mod_name:String = "", pretty:bool = false):
151151
# the logged string with "{mod_name}: "
152152
func mod_log(text:String, mod_name:String = "Unknown-Mod", pretty:bool = false)->void:
153153
# Prefix with "{mod_name}: "
154-
text = mod_name + ": " + text
154+
var prefix = mod_name + ": "
155155

156156
var date_time = Time.get_datetime_dict_from_system()
157157

@@ -165,7 +165,7 @@ func mod_log(text:String, mod_name:String = "Unknown-Mod", pretty:bool = false)-
165165

166166
var date_time_string = str(date_time.day,'.',date_time.month,'.',date_time.year,' - ', hour,':',mins,':',secs)
167167

168-
print(str(date_time_string,' ', text))
168+
print(str(date_time_string,' ', prefix, text))
169169

170170
var log_file = File.new()
171171

@@ -180,9 +180,9 @@ func mod_log(text:String, mod_name:String = "Unknown-Mod", pretty:bool = false)-
180180
return
181181
log_file.seek_end()
182182
if(pretty):
183-
log_file.store_string("\n" + str(date_time_string,' ', JSON.print(text, " ")))
183+
log_file.store_string("\n" + str(date_time_string,' ', prefix, JSON.print(text, " ")))
184184
else:
185-
log_file.store_string("\n" + str(date_time_string,' ', text))
185+
log_file.store_string("\n" + str(date_time_string,' ', prefix, text))
186186
log_file.close()
187187

188188

0 commit comments

Comments
 (0)