jw.pkg.lib: Don't log {e}

Don't log an Exception as {e} but as str(e) producing nicer output.
Or as repr(e) if a backtrace is requested, because to people who can
read backtraces, type info might be of interest. Also, remove
pointless time stamps, those belong into the logging framework.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-02-18 11:23:37 +01:00
commit 7eb15f2477
3 changed files with 5 additions and 11 deletions

View file

@ -89,7 +89,7 @@ class Cmd(abc.ABC): # export
self.__children.append(cmd)
assert len(self.__children) == len(self.__child_classes)
except Exception as e:
cmds.dump(ERR, f"Failed to add subcommands ({e})")
cmds.dump(ERR, f"Failed to add subcommands ({str(e)})")
raise
return
raise Exception(f'Tried to add sub-commands of unknown type {type(cmds)}')