Skip to content

Commit 708018d

Browse files
committed
Add more typings.
1 parent 48f70c6 commit 708018d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

logger.gd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class FilteringSink extends LogSink:
125125
_sink.close()
126126

127127
class BroadcastSink extends LogSink:
128-
var _sinks: Array = []
128+
var _sinks: Array[LogSink] = []
129129

130130
func add_sink(sink: LogSink) -> void:
131131
_sinks.append(sink)
@@ -219,7 +219,7 @@ class DirSink extends LogSink:
219219
var _max_file_size: int
220220
var _max_file_count: int
221221

222-
var _io_thread_last_dir_listing: Array = []
222+
var _io_thread_last_dir_listing: Array[String] = []
223223

224224
var _io_thread_current_file: FileAccess
225225
var _io_thread_current_file_size: int
@@ -268,7 +268,7 @@ class DirSink extends LogSink:
268268
return true
269269

270270
func _io_thread_update_dir_listing() -> void:
271-
_io_thread_last_dir_listing = []
271+
_io_thread_last_dir_listing.clear()
272272
var dir_list: DirAccess = DirAccess.open(_dir_path)
273273
if not dir_list:
274274
return
@@ -385,8 +385,8 @@ class DirSink extends LogSink:
385385

386386
class MemoryWindowSink extends LogSink:
387387
var _max_lines: int
388-
var _formatted_messages: Array = []
389-
var _log_records: Array = []
388+
var _formatted_messages: PackedStringArray = PackedStringArray()
389+
var _log_records: Array[Dictionary] = []
390390

391391
func _init(max_lines: int = 100) -> void:
392392
_max_lines = max_lines
@@ -462,7 +462,7 @@ class Logger extends LogSink:
462462
_level = level
463463
_sink = sink
464464

465-
# Write will not format the message, it will just pass it to the underlying sink.
465+
## Write will not format the message, it will just pass it to the underlying sink.
466466
func write_bulks(log_records: Array[Dictionary], formatted_messages: PackedStringArray) -> void:
467467
_sink.write_bulks(log_records, formatted_messages)
468468

0 commit comments

Comments
 (0)