Skip to content

Log to file#17

Merged
tomgeorge merged 1 commit into
editor-code-assistant:mainfrom
tomgeorge:feat/logging
Aug 6, 2025
Merged

Log to file#17
tomgeorge merged 1 commit into
editor-code-assistant:mainfrom
tomgeorge:feat/logging

Conversation

@tomgeorge

@tomgeorge tomgeorge commented Aug 5, 2025

Copy link
Copy Markdown
Member

Address #16, can also address #15 this is controlled by the sidebar module

feat(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.

  • 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

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
@tomgeorge

tomgeorge commented Aug 6, 2025

Copy link
Copy Markdown
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

@tomgeorge tomgeorge marked this pull request as ready for review August 6, 2025 15:03
@tomgeorge tomgeorge requested review from W3ND31 and ericdallo August 6, 2025 15:11

@ericdallo ericdallo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did some testing and looks good to me

@W3ND31

W3ND31 commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

LGTM

@tomgeorge tomgeorge merged commit eb5bdc4 into editor-code-assistant:main Aug 6, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants