mirror of
https://github.com/paul-nameless/tg
synced 2024-11-25 05:10:22 +00:00
Improve logging (add filename) and add help string for open_current_msg
This commit is contained in:
parent
af7f1ee202
commit
453cdbcc45
2 changed files with 5 additions and 2 deletions
|
@ -423,6 +423,7 @@ class Controller:
|
|||
|
||||
@bind(msg_handler, ["l", "^J"])
|
||||
def open_current_msg(self) -> None:
|
||||
"""Open msg or file with cmd in mailcap"""
|
||||
msg = MsgProxy(self.model.current_msg)
|
||||
self._open_msg(msg)
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ def setup_log() -> None:
|
|||
handlers.append(handler)
|
||||
|
||||
logging.basicConfig(
|
||||
format="%(levelname)-8s [%(asctime)s] %(name)s %(message)s",
|
||||
format="%(levelname)s [%(asctime)s] %(filename)s:%(lineno)s - %(funcName)s | %(message)s",
|
||||
handlers=handlers,
|
||||
)
|
||||
logging.getLogger().setLevel(config.LOG_LEVEL)
|
||||
|
@ -200,7 +200,9 @@ class suspend:
|
|||
|
||||
proc = self.call(cmd)
|
||||
if proc.returncode:
|
||||
return proc.stderr.decode()
|
||||
stderr = proc.stderr.decode()
|
||||
log.error("Error happened executing <%s>:\n%s", cmd, stderr)
|
||||
return stderr
|
||||
return ""
|
||||
|
||||
def __enter__(self) -> "suspend":
|
||||
|
|
Loading…
Reference in a new issue