Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Excessive Logging Issue with :ObsidianToday Command #526

Merged
merged 2 commits into from
Apr 4, 2024

Conversation

jmartinn
Copy link
Contributor

@jmartinn jmartinn commented Apr 4, 2024

Summary

This pull request addresses an issue introduced in commit f2eeb0a where the :ObsidianToday command in the obsidian.nvim plugin began logging excessive information upon execution. This behavior is a result of enhanced error logging and a debug print statement that was not intended for production use.

Changes Made

  • Removed the vim.print(new_note) debug statement which was responsible for logging complete note objects into the Neovim command line.
  • Retained the detailed error messages within the error handling logic, but formatted them to be more concise and only display when an error actually occurs.

Testing

The changes have been tested locally to ensure that the :ObsidianToday command operates as expected without producing unnecessary log output. The command's functionality remains intact, and only relevant error messages are displayed to the user in case of an actual error.

Impact

This fix should enhance the user experience by preventing the unintended flood of debug information to the command line, thereby keeping the logs clean and relevant to the user's actions.

Resolves: Excessive logging when running :ObsidianToday with a template defined.

Please review the changes and consider merging this pull request to improve the plugin's functionality.

Thank you for your consideration.

Fixes #525

Best regards,
jmartinn

Copy link
Owner

@epwalsh epwalsh left a comment

Choose a reason for hiding this comment

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

Thanks! Left over debugging 🤦

@epwalsh epwalsh merged commit d8bac78 into epwalsh:main Apr 4, 2024
7 checks passed
@werkz-by-drake
Copy link

werkz-by-drake commented Apr 5, 2024

I think this is still a problem? I believe I'm up to date
2024 04 05 @ 01 28 33PM@2x
2024 04 05 @ 01 28 46PM@2x

Sorry, let me know if it's unrelated and I'll file another ticket.

In the ObsidianToday note, I get log messages for:

  • Opening the file
  • Saving the file
  • On the odd occasion when leaving normal mode (maybe every 30 seconds?)

@werkz-by-drake
Copy link

^ disregard, it went away after I came back from a meeting. Sorry.

@jmartinn
Copy link
Contributor Author

jmartinn commented Apr 5, 2024

No problem @epwalsh ! If I had a dollar for every time this has happened to me... I'm happy I could help 😁

@jmartinn jmartinn deleted the fix-obsidian-today-logging branch April 5, 2024 10:40
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.

Excessive Logging When Using :ObsidianToday Command with Template
3 participants