variable logging
Posted: Saturday 16 January 2021 18:45
Is this possible ?, to make the logging variable by a selector switch?
when this works i will put this in a global function
error
2021-01-16 20:50:43.092 Error: dzVents: Error: (3.1.1) ...icz/scripts/dzVents/generated_scripts/DZ_schakelklok.lua:61: attempt to call a nil value (field 'devices')
when this works i will put this in a global function
error
2021-01-16 20:50:43.092 Error: dzVents: Error: (3.1.1) ...icz/scripts/dzVents/generated_scripts/DZ_schakelklok.lua:61: attempt to call a nil value (field 'devices')
Code: Select all
local function get_logtype()
if (domoticz.devices('logtype').state == 'info') then --(rule 61)
local logtype = domoticz.LOG_INFO
elseif (domoticz.devices('logtype').state == 'error') then
local logtype = domoticz.LOG_ERROR
elseif (domoticz.devices('logtype').state == 'debug') then
local logtype = domoticz.LOG_DEBUG
elseif (domoticz.devices('logtype').state == 'exec') then
local logtype = domoticz.LOG_MODULE_EXEC_INFO
end
return logtype
end
return
{
on ={timer = get_active_timers(Timers),},
logging ={level = get_logtype()},
execute = function(dz,item,info)