parent
61eaa41fd9
commit
9ccdee9130
2 changed files with 5 additions and 2 deletions
|
@ -21,12 +21,15 @@
|
|||
## you not needing to pass the [code]origin[/code] argument to each
|
||||
## and every log call, which is extremely annoying. Thank us later ;)
|
||||
extends CoreBaseModule
|
||||
extends Node
|
||||
class_name CoreLoggerInstance
|
||||
|
||||
## Class name
|
||||
var logger: CoreBaseModule
|
||||
var origin: String
|
||||
|
||||
func _init(origin_new: String) -> void:
|
||||
func _init(logger_new: CoreBaseModule, origin_new: String) -> void:
|
||||
logger = logger_new
|
||||
origin = origin_new
|
||||
|
||||
## Prints a diagnostic message
|
||||
|
|
|
@ -195,4 +195,4 @@ func errorf(origin: String, message: String) -> void: _log(CoreTypes.LoggerLevel
|
|||
func crashf(origin: String, message: String) -> void: crash(core.basepath.replace("res://", "") + "src/" + origin, message)
|
||||
|
||||
# Returns a logger instance
|
||||
func get_instance(origin: String) -> CoreLoggerInstance: return CoreLoggerInstance.new(origin)
|
||||
func get_instance(origin: String) -> CoreLoggerInstance: return CoreLoggerInstance.new(self, origin)
|
||||
|
|
Loading…
Reference in a new issue