func _write_log():
var path = "user://conosolelogs"
var time : String = Time.get_time_string_from_system()
var filename : String = "consolelog_"+time+".txt"
var dirAccess = DirAccess.open("user://")
if dirAccess == null:
print("DirAccess is null")
else:
dirAccess.make_dir(path)
var file = FileAccess.open(path+filename, FileAccess.WRITE)
file.store_line("test") # error here
file.close()
Error message: Attempt to call function ‘store_line’ in base ‘null instance’ on a null instance.
Changing Time.get_time_string_from_system() to Time.get_date_string_from_system() solved this problem and now it works without any errors or warnings. Thanks!