use android log categories

pull/4442/head
Martín Fernández 5 years ago committed by Frans de Jonge
parent ee673b1e10
commit 236724ef3e

@ -21,7 +21,7 @@ local function LvDEBUG(lv, ...)
end end
end end
if isAndroid then if isAndroid then
android.LOGI("#"..line) android.LOGV(line)
else else
io.stdout:write(string.format("# %s %s\n", os.date("%x-%X"), line)) io.stdout:write(string.format("# %s %s\n", os.date("%x-%X"), line))
io.stdout:flush() io.stdout:flush()

@ -50,7 +50,15 @@ local function log(log_lvl, dump_lvl, ...)
end end
end end
if isAndroid then if isAndroid then
android.LOGI(LOG_PREFIX[log_lvl]..line) if log_lvl == "dbg" then
android.LOGV(line)
elseif log_lvl == "info" then
android.LOGI(line)
elseif log_lvl == "warn" then
android.LOGW(line)
elseif log_lvl == "err" then
android.LOGE(line)
end
else else
io.stdout:write(os.date("%x-%X"), " ", LOG_PREFIX[log_lvl], line, "\n") io.stdout:write(os.date("%x-%X"), " ", LOG_PREFIX[log_lvl], line, "\n")
io.stdout:flush() io.stdout:flush()

Loading…
Cancel
Save