added webconsole
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package kernel;
|
||||
|
||||
import util.Debug;
|
||||
import kernel.ui.WindowContext;
|
||||
import kernel.ui.WindowManager;
|
||||
import lib.TermWriteable;
|
||||
@@ -18,18 +19,30 @@ class Log {
|
||||
|
||||
public static function info(msg: Dynamic, ?pos:haxe.PosInfos){
|
||||
writer.writeLn("[INFO]["+pos.className+"]: "+Std.string(msg));
|
||||
#if webconsole
|
||||
Debug.printWeb("[INFO]["+pos.className+"]: "+Std.string(msg));
|
||||
#end
|
||||
}
|
||||
|
||||
public static function warn(msg: Dynamic, ?pos:haxe.PosInfos){
|
||||
writer.writeLn("[WARN]["+pos.className+"]: "+Std.string(msg),Yellow);
|
||||
#if webconsole
|
||||
Debug.printWeb("[WARN]["+pos.className+"]: "+Std.string(msg));
|
||||
#end
|
||||
}
|
||||
|
||||
public static function error(msg: Dynamic,?pos:haxe.PosInfos) {
|
||||
writer.writeLn("[ERRO]["+pos.className+"]: "+Std.string(msg),Red);
|
||||
#if webconsole
|
||||
Debug.printWeb("[ERRO]["+pos.className+"]: "+Std.string(msg));
|
||||
#end
|
||||
}
|
||||
|
||||
public static function debug(msg: Dynamic,?pos:haxe.PosInfos) {
|
||||
writer.writeLn("[DEBG]["+pos.className+"]: "+Std.string(msg),Gray);
|
||||
#if webconsole
|
||||
Debug.printWeb("[DEBG]["+pos.className+"]: "+Std.string(msg));
|
||||
#end
|
||||
}
|
||||
|
||||
public static function moveToOutput(addr: String) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package util;
|
||||
|
||||
import cc.HTTP;
|
||||
import cc.ComputerCraft;
|
||||
import kernel.Log;
|
||||
|
||||
@@ -13,4 +14,10 @@ class Debug {
|
||||
|
||||
Log.debug("CC/MC version:" + ComputerCraft._HOST);
|
||||
}
|
||||
|
||||
#if webconsole
|
||||
public static function printWeb(msg: String) {
|
||||
HTTP.post("http://127.0.0.1:8080/",msg);
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user