zeth icon indicating copy to clipboard operation
zeth copied to clipboard

Clean logging

Open AntoineRondelet opened this issue 5 years ago • 3 comments

It is important to have proper logs to nicely follow the execution of the program and ease the debug. As such it would be nice to clean the way we log messages, and support various levels of severity (INFO, DEBUG, WARN, ERROR, FATAL).

See: https://www.boost.org/doc/libs/1_64_0/libs/log/doc/html/log/tutorial.html for eg

AntoineRondelet avatar Mar 23 '20 10:03 AntoineRondelet

Related: https://github.com/clearmatics/zeth/pull/171#pullrequestreview-379293548

AntoineRondelet avatar Mar 23 '20 10:03 AntoineRondelet

Adding proper logging (with several severity levels) would also be a great improvement on the Python wallet side of things. See https://github.com/clearmatics/zeth/pull/343#discussion_r557541594

AntoineRondelet avatar Jan 14 '21 16:01 AntoineRondelet

Just to note, we might want to consider carefully the behaviour we want in terms of the command line tools.

I think the ideal for command line tools would be to match what most unix tools do: minimal output (simple messages and maybe even spinners for longer running commands (where the output is to a terminal), OR undecorated results, as machine-readable as possible, for commands that generate or query individual bits of data). Then -d or -v flags should enable any "logging"-style messages for debugging, also to stdout or perhaps stderr so we don't break composability of the tools. Unlike the case of a daemon / server, it seems to me that by default cli tools should not create files for logging, unless the user asks for this explicitly or handles it manually (e.g. using pipes).

IIRC the standard python logging framework can handle all of this pretty easily.

dtebbs avatar Jan 14 '21 18:01 dtebbs