use android log categories

This commit is contained in:
Martín Fernández
2018-12-29 20:47:45 +01:00
committed by Frans de Jonge
parent ee673b1e10
commit 236724ef3e
2 changed files with 10 additions and 2 deletions

View File

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

View File

@@ -50,7 +50,15 @@ local function log(log_lvl, dump_lvl, ...)
end
end
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
io.stdout:write(os.date("%x-%X"), " ", LOG_PREFIX[log_lvl], line, "\n")
io.stdout:flush()