We need an RFC spelling out how error logging should work. A first sketch:
Error log
Whenever errors occur, they should be stored in a log file somewhere within the user's Notion directory.
The main log file should put the most useful information at the top -- probably the error message with some combination of that error's stack trace and/or the root cause error's stack trace.
There should be extremely clear separators between errors in the cause chain.
The log file should contain the whole cause chain, with details that are less likely to be useful pushed down lower than the most useful info.
Log rolling
A small number of older error logs should be automatically saved in a subdirectory of the user's Notion directory, maybe just 10 with .1.log through .9.log suffixes.
Perhaps the number of archived logs could be configurable via the config file, but this seems lower priority.
Some possible other commands
notion logfile -- print out the path to the log file for easy piping to other commands
notion log -- print out a nicely formatted log of the last generated error log, piped to a paginator
Verbose mode
When Notion is run in verbose mode, the CLI output should be similar to notion log.
We need an RFC spelling out how error logging should work. A first sketch:
Error log
Log rolling
.1.log
through.9.log
suffixes.Some possible other commands
notion logfile
-- print out the path to the log file for easy piping to other commandsnotion log
-- print out a nicely formatted log of the last generated error log, piped to a paginatorVerbose mode
notion log
.