Log to file#17
Merged
Merged
Conversation
Currently the plugin uses vim.notify for almost all logging and can get
quite noisy. Many neovim systems and plugins log to files in
$XDG_STATE_DIR. This introduces a logging module and logs to a default
file. There is also some bookkeeping stuff in here too.
- Add `config.log`
- Default log file is `$XDG_STATE_DIR/nvim/eca.log`
- Default display mode is a buffer, can also display in a popup
- Default log level is vim.log.levels.INFO
- Default max file size before warning is 10MB
- Remove `config.debug`
- Create `Logger` module. Has the regular logging functions as well as
`Logger.notify` for displaying a notification via `vim.notify`
- Add subcommands to EcaLogs ("show", "log_path", "clear", "stats"),
`EcaLogs` called with no arguments runs `EcaLogs show`
- Replace calls to Utils logging functions with Logger
- Fix the github action to run the tests
Member
Author
|
This ended up being kind of a doozy, @ericdallo @W3ND31 @joaopluigi please review and test. A few stylua changes made it into the PR as well. If it is too much to look at I can yank those out |
ericdallo
approved these changes
Aug 6, 2025
ericdallo
left a comment
Member
There was a problem hiding this comment.
Did some testing and looks good to me
W3ND31
approved these changes
Aug 6, 2025
Contributor
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Address #16,
can also address #15this is controlled by the sidebar modulefeat(logger): Add a log module
Currently the plugin uses vim.notify for almost all logging and can get
quite noisy. Many neovim systems and plugins log to files in
$XDG_STATE_DIR. This introduces a logging module and logs to a default
file. There is also some bookkeeping stuff in here too.
config.log$XDG_STATE_DIR/nvim/eca.logconfig.debugLoggermodule. Has the regular logging functions as well asLogger.notifyfor displaying a notification viavim.notifyEcaLogscalled with no arguments runsEcaLogs show