mirror of
https://github.com/kepler155c/opus
synced 2025-08-03 20:43:46 +00:00
rename debug function
This commit is contained in:
parent
9484153f38
commit
846569952c
@ -68,7 +68,6 @@ local function encodeCommon(val, pretty, tabLevel, tTracking)
|
|||||||
str = str .. encodeCommon(v, pretty, tabLevel, tTracking)
|
str = str .. encodeCommon(v, pretty, tabLevel, tTracking)
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
debug(val)
|
|
||||||
arrEncoding(val, "{", "}", pairs, function(k,v)
|
arrEncoding(val, "{", "}", pairs, function(k,v)
|
||||||
assert(type(k) == "string", "JSON object keys must be strings", 2)
|
assert(type(k) == "string", "JSON object keys must be strings", 2)
|
||||||
str = str .. encodeCommon(k, pretty, tabLevel, tTracking)
|
str = str .. encodeCommon(k, pretty, tabLevel, tTracking)
|
||||||
|
@ -11,7 +11,7 @@ for k,v in pairs(_ENV) do
|
|||||||
sandboxEnv[k] = v
|
sandboxEnv[k] = v
|
||||||
end
|
end
|
||||||
|
|
||||||
_G.debug = function() end
|
_G._debug = function() end
|
||||||
|
|
||||||
local function makeEnv()
|
local function makeEnv()
|
||||||
local env = setmetatable({ }, { __index = _G })
|
local env = setmetatable({ }, { __index = _G })
|
||||||
|
@ -32,7 +32,7 @@ local config = {
|
|||||||
backgroundColor = colors.gray,
|
backgroundColor = colors.gray,
|
||||||
tabBarBackgroundColor = colors.gray,
|
tabBarBackgroundColor = colors.gray,
|
||||||
focusBackgroundColor = colors.gray,
|
focusBackgroundColor = colors.gray,
|
||||||
errorColor = colors.red,
|
errorColor = colors.black,
|
||||||
},
|
},
|
||||||
color = {
|
color = {
|
||||||
textColor = colors.lightGray,
|
textColor = colors.lightGray,
|
||||||
@ -41,7 +41,7 @@ local config = {
|
|||||||
backgroundColor = colors.gray,
|
backgroundColor = colors.gray,
|
||||||
tabBarBackgroundColor = colors.gray,
|
tabBarBackgroundColor = colors.gray,
|
||||||
focusBackgroundColor = colors.gray,
|
focusBackgroundColor = colors.gray,
|
||||||
errorColor = colors.black,
|
errorColor = colors.red,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
Config.load('multishell', config)
|
Config.load('multishell', config)
|
||||||
|
@ -28,7 +28,7 @@ local focusedRoutineEvents = Util.transpose {
|
|||||||
'paste', 'terminate',
|
'paste', 'terminate',
|
||||||
}
|
}
|
||||||
|
|
||||||
_G.debug = function(pattern, ...)
|
_G._debug = function(pattern, ...)
|
||||||
local oldTerm = term.redirect(kernel.window)
|
local oldTerm = term.redirect(kernel.window)
|
||||||
Util.print(pattern, ...)
|
Util.print(pattern, ...)
|
||||||
term.redirect(oldTerm)
|
term.redirect(oldTerm)
|
||||||
|
@ -33,7 +33,7 @@ function transport.read(socket)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function transport.write(socket, data)
|
function transport.write(socket, data)
|
||||||
--debug('>> ' .. Util.tostring({ type = 'DATA', seq = socket.wseq }))
|
--_debug('>> ' .. Util.tostring({ type = 'DATA', seq = socket.wseq }))
|
||||||
socket.transmit(socket.dport, socket.dhost, data)
|
socket.transmit(socket.dport, socket.dhost, data)
|
||||||
|
|
||||||
--local timerId = os.startTimer(3)
|
--local timerId = os.startTimer(3)
|
||||||
@ -45,7 +45,7 @@ function transport.write(socket, data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function transport.ping(socket)
|
function transport.ping(socket)
|
||||||
--debug('>> ' .. Util.tostring({ type = 'DATA', seq = socket.wseq }))
|
--_debug('>> ' .. Util.tostring({ type = 'DATA', seq = socket.wseq }))
|
||||||
if os.clock() - socket.activityTimer > 10 then
|
if os.clock() - socket.activityTimer > 10 then
|
||||||
socket.activityTimer = os.clock()
|
socket.activityTimer = os.clock()
|
||||||
socket.transmit(socket.dport, socket.dhost, {
|
socket.transmit(socket.dport, socket.dhost, {
|
||||||
@ -78,7 +78,7 @@ Event.on('modem_message', function(_, _, dport, dhost, msg, distance)
|
|||||||
local socket = transport.sockets[dport]
|
local socket = transport.sockets[dport]
|
||||||
if socket and socket.connected then
|
if socket and socket.connected then
|
||||||
|
|
||||||
--if msg.type then debug('<< ' .. Util.tostring(msg)) end
|
--if msg.type then _debug('<< ' .. Util.tostring(msg)) end
|
||||||
|
|
||||||
if msg.type == 'DISC' then
|
if msg.type == 'DISC' then
|
||||||
-- received disconnect from other end
|
-- received disconnect from other end
|
||||||
@ -108,9 +108,9 @@ Event.on('modem_message', function(_, _, dport, dhost, msg, distance)
|
|||||||
socket.activityTimer = os.clock()
|
socket.activityTimer = os.clock()
|
||||||
if msg.seq ~= socket.rseq then
|
if msg.seq ~= socket.rseq then
|
||||||
print('transport seq error - closing socket ' .. socket.sport)
|
print('transport seq error - closing socket ' .. socket.sport)
|
||||||
debug(msg.data)
|
_debug(msg.data)
|
||||||
debug('current ' .. socket.rseq)
|
_debug('current ' .. socket.rseq)
|
||||||
debug('expected ' .. msg.seq)
|
_debug('expected ' .. msg.seq)
|
||||||
-- socket:close()
|
-- socket:close()
|
||||||
-- os.queueEvent('transport_' .. socket.uid)
|
-- os.queueEvent('transport_' .. socket.uid)
|
||||||
else
|
else
|
||||||
@ -122,7 +122,7 @@ Event.on('modem_message', function(_, _, dport, dhost, msg, distance)
|
|||||||
os.queueEvent('transport_' .. socket.uid)
|
os.queueEvent('transport_' .. socket.uid)
|
||||||
end
|
end
|
||||||
|
|
||||||
--debug('>> ' .. Util.tostring({ type = 'ACK', seq = msg.seq }))
|
--_debug('>> ' .. Util.tostring({ type = 'ACK', seq = msg.seq }))
|
||||||
--socket.transmit(socket.dport, socket.dhost, {
|
--socket.transmit(socket.dport, socket.dhost, {
|
||||||
-- type = 'ACK',
|
-- type = 'ACK',
|
||||||
-- seq = msg.seq,
|
-- seq = msg.seq,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user