improved logging system
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package lib;
|
||||
|
||||
import kernel.http.HTTPRequest.Http;
|
||||
import lua.TableTools;
|
||||
import kernel.KernelEvents;
|
||||
import kernel.log.Log;
|
||||
import lua.NativeStringTools;
|
||||
import lib.ui.Canvas;
|
||||
@@ -9,6 +9,7 @@ import cc.ComputerCraft;
|
||||
#if webconsole
|
||||
import cc.HTTP;
|
||||
import kernel.net.Net;
|
||||
import kernel.log.LogLine;
|
||||
#end
|
||||
|
||||
class Debug {
|
||||
@@ -66,8 +67,8 @@ class Debug {
|
||||
#end
|
||||
|
||||
#if webconsole
|
||||
public static function printWeb(msg:String) {
|
||||
HTTP.request("http://127.0.0.1:8080/" + Net.networkID, msg);
|
||||
public static function logToWebconsole(line:LogLine) {
|
||||
Http.request('http://127.0.0.1:8080/log/${Net.networkID}/${line.level.getIndex()}', '[${line.origin}] ${line.message}').eager();
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user