Browse Source

use android log categories

pull/4442/head
Martín Fernández 2 years ago
committed by Frans de Jonge
parent
commit
236724ef3e
2 changed files with 10 additions and 2 deletions
  1. +1
    -1
      frontend/dbg.lua
  2. +9
    -1
      frontend/logger.lua

+ 1
- 1
frontend/dbg.lua 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()

+ 9
- 1
frontend/logger.lua 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()

Loading…
Cancel
Save