rename debug function

This commit is contained in:
kepler155c@gmail.com 2018-10-31 00:05:29 -04:00
parent 9484153f38
commit 846569952c
5 changed files with 11 additions and 12 deletions

View File

@ -68,7 +68,6 @@ local function encodeCommon(val, pretty, tabLevel, tTracking)
str = str .. encodeCommon(v, pretty, tabLevel, tTracking)
end)
else
debug(val)
arrEncoding(val, "{", "}", pairs, function(k,v)
assert(type(k) == "string", "JSON object keys must be strings", 2)
str = str .. encodeCommon(k, pretty, tabLevel, tTracking)

View File

@ -11,7 +11,7 @@ for k,v in pairs(_ENV) do
sandboxEnv[k] = v
end
_G.debug = function() end
_G._debug = function() end
local function makeEnv()
local env = setmetatable({ }, { __index = _G })

View File

@ -32,7 +32,7 @@ local config = {
backgroundColor = colors.gray,
tabBarBackgroundColor = colors.gray,
focusBackgroundColor = colors.gray,
errorColor = colors.red,
errorColor = colors.black,
},
color = {
textColor = colors.lightGray,
@ -41,7 +41,7 @@ local config = {
backgroundColor = colors.gray,
tabBarBackgroundColor = colors.gray,
focusBackgroundColor = colors.gray,
errorColor = colors.black,
errorColor = colors.red,
},
}
Config.load('multishell', config)

View File

@ -28,7 +28,7 @@ local focusedRoutineEvents = Util.transpose {
'paste', 'terminate',
}
_G.debug = function(pattern, ...)
_G._debug = function(pattern, ...)
local oldTerm = term.redirect(kernel.window)
Util.print(pattern, ...)
term.redirect(oldTerm)

View File

@ -33,7 +33,7 @@ function transport.read(socket)
end
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)
--local timerId = os.startTimer(3)
@ -45,7 +45,7 @@ function transport.write(socket, data)
end
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
socket.activityTimer = os.clock()
socket.transmit(socket.dport, socket.dhost, {
@ -78,7 +78,7 @@ Event.on('modem_message', function(_, _, dport, dhost, msg, distance)
local socket = transport.sockets[dport]
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
-- received disconnect from other end
@ -108,9 +108,9 @@ Event.on('modem_message', function(_, _, dport, dhost, msg, distance)
socket.activityTimer = os.clock()
if msg.seq ~= socket.rseq then
print('transport seq error - closing socket ' .. socket.sport)
debug(msg.data)
debug('current ' .. socket.rseq)
debug('expected ' .. msg.seq)
_debug(msg.data)
_debug('current ' .. socket.rseq)
_debug('expected ' .. msg.seq)
-- socket:close()
-- os.queueEvent('transport_' .. socket.uid)
else
@ -122,7 +122,7 @@ Event.on('modem_message', function(_, _, dport, dhost, msg, distance)
os.queueEvent('transport_' .. socket.uid)
end
--debug('>> ' .. Util.tostring({ type = 'ACK', seq = msg.seq }))
--_debug('>> ' .. Util.tostring({ type = 'ACK', seq = msg.seq }))
--socket.transmit(socket.dport, socket.dhost, {
-- type = 'ACK',
-- seq = msg.seq,