From 236724ef3e2cb0bd79c671e8bbd4a8f24ac177ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Fern=C3=A1ndez?= Date: Sat, 29 Dec 2018 20:47:45 +0100 Subject: [PATCH] use android log categories --- frontend/dbg.lua | 2 +- frontend/logger.lua | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/dbg.lua b/frontend/dbg.lua index 0532f42eb..a8308c7a6 100644 --- a/frontend/dbg.lua +++ b/frontend/dbg.lua @@ -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() diff --git a/frontend/logger.lua b/frontend/logger.lua index e250e05bf..bbfcda8a0 100644 --- a/frontend/logger.lua +++ b/frontend/logger.lua @@ -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()