Bug report changes (#7709)

* android: dump logcat to file
* Update .github/ISSUE_TEMPLATE/bug_report.md

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
This commit is contained in:
Martín Fernández
2021-05-23 01:20:13 +02:00
committed by GitHub
parent 8315ee1c7e
commit fdb0539aae
3 changed files with 22 additions and 6 deletions

View File

@@ -53,10 +53,26 @@ common_info.about = {
common_info.report_bug = {
text = _("Report a bug"),
keep_menu_open = true,
callback = function()
callback_func = function()
local DataStorage = require("datastorage")
local log_path = string.format("%s/%s", DataStorage:getDataDir(), "crash.log")
local common_msg = T(_("Please report bugs to \nhttps://github.com/koreader/koreader/issues\n\nVersion:\n%1\n\nDetected device:\n%2"),
Version:getCurrentRevision(), Device:info())
local log_msg = T(_("Attach %1 to your bug report."), log_path)
if Device:isAndroid() then
local android = require("android")
android.dumpLogs(log_path)
end
local msg
if lfs.attributes(log_path, "mode") == "file" then
msg = string.format("%s\n\n%s", common_msg, log_msg)
else
msg = common_msg
end
UIManager:show(InfoMessage:new{
text = T(_("Please report bugs to \nhttps://github.com/koreader/koreader/issues\n\nVersion:\n%1\n\nDetected device:\n%2"),
Version:getCurrentRevision(), Device:info()),
text = msg,
})
end
}