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
|
## you not needing to pass the [code]origin[/code] argument to each
|
||||||
## and every log call, which is extremely annoying. Thank us later ;)
|
## and every log call, which is extremely annoying. Thank us later ;)
|
||||||
extends CoreBaseModule
|
extends CoreBaseModule
|
||||||
|
extends Node
|
||||||
class_name CoreLoggerInstance
|
class_name CoreLoggerInstance
|
||||||
|
|
||||||
## Class name
|
## Class name
|
||||||
|
var logger: CoreBaseModule
|
||||||
var origin: String
|
var origin: String
|
||||||
|
|
||||||
func _init(origin_new: String) -> void:
|
func _init(logger_new: CoreBaseModule, origin_new: String) -> void:
|
||||||
|
logger = logger_new
|
||||||
origin = origin_new
|
origin = origin_new
|
||||||
|
|
||||||
## Prints a diagnostic message
|
## 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)
|
func crashf(origin: String, message: String) -> void: crash(core.basepath.replace("res://", "") + "src/" + origin, message)
|
||||||
|
|
||||||
# Returns a logger instance
|
# 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