I find myself wanting a logging system (to file) to more easily be able to debug.
I can implement this, but I want to check a couple of things first:
- Is that something you want in cliamp?
- If yes, do you have any strong preferences on libraries and ux?
My suggestion is something like this:
Setup:
- library:
log/slog
- format: plain text
- config:
log_level = "info"
- CLI override:
--log-level debug|info|warn|error
- file output:
~/.config/cliamp/cliamp.log
Behavior/DX:
- Keep stdout/stderr for non-TUI commands and fatal startup errors
- Refactor applog into a app-wide logger as a thin facade over slog with "intent-based" logging (you don't specify sinks, you specify intent), something like (first draft):
applog.(Debug(f)|Info(f)|Warn(f)|Error(f)) = diagnostic log
applog.Status(f) = footer
applog.(UserWarn(f)|UserError(f)) = diagnostic log + footer
- Possible addition: set this up for plugins to utilize as well somehow (haven't given this part so much thought yet)
Let me know what you think.
I find myself wanting a logging system (to file) to more easily be able to debug.
I can implement this, but I want to check a couple of things first:
My suggestion is something like this:
Setup:
log/sloglog_level = "info"--log-level debug|info|warn|error~/.config/cliamp/cliamp.logBehavior/DX:
applog.(Debug(f)|Info(f)|Warn(f)|Error(f))= diagnostic logapplog.Status(f)= footerapplog.(UserWarn(f)|UserError(f))= diagnostic log + footerLet me know what you think.