0
0
mirror of https://github.com/Doodle3D/doodle3d-firmware.git synced 2024-12-22 02:53:49 +01:00

Fixups after cherry-picking commits from unify-logging+chunk-checking branch:

- add missing log module arguments,
- remove temporary log level mapping.
This commit is contained in:
Wouter R 2014-06-04 23:19:59 +02:00
parent bca5228b73
commit 52c9435534
2 changed files with 8 additions and 13 deletions

View File

@ -77,9 +77,9 @@ local function setupAutoWifiMode()
-- signin to connect.doodle3d.com
local success, output = Signin.signin()
if success then
log:info("Signed in")
log:info(MOD_ABBR, "Signed in")
else
log:info("Signing in failed")
log:info(MOD_ABBR, "Signing in failed")
end
-- report we are connected after signin attempt
netconf.setStatus(netconf.CONNECTED,"Connected");
@ -131,11 +131,6 @@ local function setupLogger()
local logTargetSetting = settings.getSystemKey('logfile')
local logLevelSetting = settings.get('system.log.level')
local logTargetError, logLevelError = nil, nil
-- TEMP: for now, translate print3d log level to firmware level, these will be unfiied in the future
-- we get (print3d): quiet,error,warning,info,verbose,bulk -- and we need (firmware): debug,info,warn,error,fatal
logLevelMapping = { quiet='fatal', error='error', warning='warn', info='warn', verbose='info', bulk='debug' }
logLevelSetting = logLevelMapping[logLevelSetting]
if type(logTargetSetting) == 'string' then
local specialTarget = logTargetSetting:match('^<(.*)>$')

View File

@ -27,12 +27,12 @@ local deviceName, deviceApi
local cachedApSsid, baseApSsid = nil, nil
function M.getSubstitutedSsid(unformattedSsid)
log:debug("getSubstitutedSsid unformattedSsid:'" .. (unformattedSsid or "nil") .. "' baseApSsid:'" .. (baseApSsid or "nil") .. "' cachedApSsid:'" .. (cachedApSsid or "nil"))
log:debug(MOD_ABBR, "getSubstitutedSsid unformattedSsid:'" .. (unformattedSsid or "nil") .. "' baseApSsid:'" .. (baseApSsid or "nil") .. "' cachedApSsid:'" .. (cachedApSsid or "nil"))
if unformattedSsid == baseApSsid and cachedApSsid ~= nil then return cachedApSsid end
if not unformattedSsid or type(unformattedSsid) ~= 'string' then return nil end
local macTail = M.getMacAddress():sub(7)
log:debug(" macTail:'" .. macTail)
log:debug(MOD_ABBR, " macTail:'" .. macTail)
baseApSsid = unformattedSsid
cachedApSsid = unformattedSsid:gsub('%%%%MAC_ADDR_TAIL%%%%', macTail)
return cachedApSsid
@ -109,9 +109,9 @@ end
--returns the wireless device's MAC address (as string, without colons)
--(lua numbers on openWrt seem to be 32bit so they cannot represent a MAC address as one number)
function M.getMacAddress()
log:debug("getMacAddress")
log:debug(MOD_ABBR, "getMacAddress")
local macText = utils.readFile('/sys/class/net/' .. deviceName .. '/address')
log:debug(" macText: '" .. (macText or "nil") .. "'")
log:debug(MOD_ABBR, " macText: '" .. (macText or "nil") .. "'")
local out = ''
-- Hack to prevent failure in case the MAC address could not be obtained.
@ -143,9 +143,9 @@ end
-- @return data for all or requested network; false+error on failure or nil when requested network not found
function M.getScanInfo(ssid)
local iw = iwinfo[deviceApi]
log:info("start wifi scan")
log:info(MOD_ABBR, "start wifi scan")
local sr = iw.scanlist(deviceName)
log:info("wifi scan done")
log:info(MOD_ABBR, "wifi scan done")
local si, se
if ssid == nil then