From 846569952c9aa90d4985af7e2613f2eeb9ca20f3 Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Wed, 31 Oct 2018 00:05:29 -0400 Subject: [PATCH] rename debug function --- sys/apis/json.lua | 1 - sys/boot/opus.boot | 2 +- sys/extensions/7.multishell.lua | 4 ++-- sys/kernel.lua | 2 +- sys/network/transport.lua | 14 +++++++------- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/sys/apis/json.lua b/sys/apis/json.lua index 6a1a921..64f8825 100644 --- a/sys/apis/json.lua +++ b/sys/apis/json.lua @@ -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) diff --git a/sys/boot/opus.boot b/sys/boot/opus.boot index 32c7010..8c5c413 100644 --- a/sys/boot/opus.boot +++ b/sys/boot/opus.boot @@ -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 }) diff --git a/sys/extensions/7.multishell.lua b/sys/extensions/7.multishell.lua index b3c2a99..341800b 100644 --- a/sys/extensions/7.multishell.lua +++ b/sys/extensions/7.multishell.lua @@ -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) diff --git a/sys/kernel.lua b/sys/kernel.lua index 2f5b457..b130204 100644 --- a/sys/kernel.lua +++ b/sys/kernel.lua @@ -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) diff --git a/sys/network/transport.lua b/sys/network/transport.lua index 77342c2..48d7a62 100644 --- a/sys/network/transport.lua +++ b/sys/network/transport.lua @@ -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,