milo stats

This commit is contained in:
kepler155c@gmail.com
2019-02-13 23:45:39 -05:00
parent e1b6d46d9d
commit d26092baa6
2 changed files with 37 additions and 3 deletions

View File

@@ -67,6 +67,7 @@ local context = {
tasks = { },
queue = { },
plugins = { },
loggers = { },
storage = Storage(),
turtleInventory = {
@@ -187,4 +188,17 @@ os.queueEvent(
context.storage:isOnline() and 'storage_online' or 'storage_offline',
context.storage:isOnline())
UI:pullEvents()
local oldDebug = _G._debug
_G._debug = function(...)
for _,v in pairs(context.loggers) do
v(...)
end
oldDebug(...)
end
local s, m = pcall(function()
UI:pullEvents()
end)
_G._debug = oldDebug
if not s then error(m) end