logging!!

This commit is contained in:
Yoshman29
2022-11-02 19:32:46 +01:00
parent 4ae869f17c
commit 23045f3fba
14 changed files with 219 additions and 34 deletions
+15 -2
View File
@@ -135,6 +135,17 @@ class Script extends FlxBasic implements IFlxDestroyable {
}
/**
* Traces something as this script.
*/
public function trace(v:Dynamic) {
Logs.traceColored([
Logs.logText('${fileName}: ', GREEN),
Logs.logText(Std.string(v))
], TRACE);
}
/**
* Calls the function `func` defined in the script.
* @param func Name of the function
@@ -177,8 +188,10 @@ class Script extends FlxBasic implements IFlxDestroyable {
* @param additionalInfo Additional information you could provide.
*/
public function error(text:String, ?additionalInfo:Dynamic):Void {
// TODO: Logs (like on YCE)
trace('$text');
Logs.traceColored([
Logs.logText(fileName, GREEN),
Logs.logText(text)
], ERROR);
}
/**