mirror of
https://github.com/Doodle3D/doodle3d-firmware.git
synced 2024-11-05 06:03:23 +01:00
Logging:
- log only one line when signing in; - change level of UCI/init.d changes from info to verbose; - change log level of network:getStatus message from info to verbose.
This commit is contained in:
parent
b4aa1a9746
commit
65062207ff
@ -64,7 +64,7 @@ function M.switchConfiguration(components)
|
||||
for k,v in pairs(components) do
|
||||
local fname = k .. '_' .. v
|
||||
if type(reconf[fname]) == 'function' then
|
||||
log:info(MOD_ABBR, "reconfiguring component '" .. k .. "' (" .. v .. ")")
|
||||
log:verbose(MOD_ABBR, "reconfiguring component '" .. k .. "' (" .. v .. ")")
|
||||
reconf[fname](dirtyList)
|
||||
else
|
||||
log:warning(MOD_ABBR, "unknown component or action '" .. fname .. "' skipped")
|
||||
@ -81,12 +81,12 @@ function M.switchConfiguration(components)
|
||||
end
|
||||
|
||||
function M.commitComponent(c)
|
||||
log:info(MOD_ABBR, "committing component '" .. c .. "'")
|
||||
log:verbose(MOD_ABBR, "committing component '" .. c .. "'")
|
||||
uci:commit(c)
|
||||
end
|
||||
|
||||
function M.reloadComponent(c, silent)
|
||||
log:info(MOD_ABBR, "reloading component '" .. c .. "'")
|
||||
log:verbose(MOD_ABBR, "reloading component '" .. c .. "'")
|
||||
local command = 'reload'
|
||||
local cmd = '/etc/init.d/' .. c .. ' '..command
|
||||
if silent ~= nil and silent then
|
||||
@ -94,7 +94,7 @@ function M.reloadComponent(c, silent)
|
||||
os.execute(cmd)
|
||||
else
|
||||
rv = utils.captureCommandOutput(cmd)
|
||||
log:info(MOD_ABBR, " result reloading component '" .. c .. "' (cmd: '"..cmd.."'): \n"..utils.dump(rv))
|
||||
log:verbose(MOD_ABBR, " result reloading component '" .. c .. "' (cmd: '"..cmd.."'): \n"..utils.dump(rv))
|
||||
end
|
||||
end
|
||||
|
||||
@ -423,7 +423,7 @@ function M.disassociate()
|
||||
end
|
||||
|
||||
function M.getStatus()
|
||||
log:info(MOD_ABBR, "network:getStatus")
|
||||
log:verbose(MOD_ABBR, "network:getStatus")
|
||||
local file, error = io.open('/tmp/networkstatus.txt','r')
|
||||
if file == nil then
|
||||
--log:error(MOD_ABBR, "Util:Access:Can't read controller file. Error: "..error)
|
||||
|
@ -107,7 +107,7 @@ function M.getStatus()
|
||||
end
|
||||
|
||||
function M.setStatus(code,msg)
|
||||
log:info(MOD_ABBR, "signin:setStatus: "..code.." | "..msg)
|
||||
log:verbose(MOD_ABBR, "signin:setStatus: " .. code .. " (" .. msg .. ")")
|
||||
status.set(STATUS_FILE,code,msg);
|
||||
end
|
||||
|
||||
|
@ -203,14 +203,13 @@ function M.remove_POST(request, response)
|
||||
end
|
||||
|
||||
function M.signin(request, response)
|
||||
log:info(MOD_ABBR, "API:network/signin")
|
||||
local success, output = signin.signin()
|
||||
if success then
|
||||
log:info(MOD_ABBR, " signed in")
|
||||
log:info(MOD_ABBR, "signed in")
|
||||
response:setSuccess("API:Network:signed in")
|
||||
response:addData("response", output)
|
||||
else
|
||||
log:info(MOD_ABBR, "signing in failed")
|
||||
log:warning(MOD_ABBR, "signing in failed")
|
||||
response:setError("Signing in failed")
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user