summaryrefslogtreecommitdiff
path: root/src/modules/debug_shell.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/debug_shell.lua')
-rw-r--r--src/modules/debug_shell.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/modules/debug_shell.lua b/src/modules/debug_shell.lua
index 1c473bd..72be4e7 100644
--- a/src/modules/debug_shell.lua
+++ b/src/modules/debug_shell.lua
@@ -188,14 +188,15 @@ function debug_shell:new(config)
end
function debug_shell:exec_cmd(socket)
- log.printf(log.DEBUG, "debug shell: received string: '%s'", socket.in_buffer)
+ local client_name = socket.client_instance.name
+ log.printf(log.DEBUG, client_name .. ": received string: '%s'", socket.in_buffer)
local ret = defines.OK
local luacode = string.match(socket.in_buffer, "^!(.*)$");
if(luacode and luacode ~= "") then
local chunk = loadstring(luacode)
if(chunk) then
- log.printf(log.DEBUG, "debug shell: calling lua command: '%s'", luacode)
+ log.printf(log.DEBUG, client_name .. ": calling lua command: '%s'", luacode)
local results = { pcall(chunk) }
if(results[1]) then
for i,result in ipairs(results) do
@@ -214,19 +215,19 @@ function debug_shell:exec_cmd(socket)
if(cmd == 'quit') then
if(sep and sep ~= "") then socket.out_buffer = socket.out_buffer .. "unknown command\n" end
- log.printf(log.INFO, "debug shell: quitting debug session")
+ log.printf(log.INFO, client_name .. ": quitting debug session")
ret = defines.KILL_CLIENT
elseif(cmd == 'disable') then
if(sep and sep ~= "") then socket.out_buffer = socket.out_buffer .. "unknown command\n" end
- log.printf(log.NOTICE, "debug shell: disabling this debug shell instance and close all connections")
+ log.printf(log.NOTICE, client_name .. ": disabling this debug shell instance and close all connections")
ret = defines.KILL_MODULE
elseif(cmd == 'disableall') then
if(sep and sep ~= "") then socket.out_buffer = socket.out_buffer .. "unknown command\n" end
- log.printf(log.NOTICE, "debug shell: disabling all debug shell instances and close all connections")
+ log.printf(log.NOTICE, client_name .. ": disabling all debug shell instances and close all connections")
ret = defines.KILL_MODULE_CLASS
elseif(cmd == 'terminate') then
if(sep and sep ~= "") then socket.out_buffer = socket.out_buffer .. "unknown command\n" end
- log.printf(log.NOTICE, "debug shell: terminate command received")
+ log.printf(log.NOTICE, client_name .. ": terminate command received")
ret = defines.KILL_DAEMON
elseif(cmd == 'help') then
if(sep and sep ~= "") then socket.out_buffer = socket.out_buffer .. "unknown command\n" end