8000 Improve Serenade logging by sombrafam · Pull Request #33 · serenadeai/serenade · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improve Serenade logging #33

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sombrafam
Copy link
@sombrafam sombrafam commented Sep 10, 2024

Approved Issue:

Description

This commit adds new framework for logging across modules. It allows amongst other things:

  • several levels of logging (ERROR, WARNING, INFO, DEBUG)
  • adds time stamping
  • facilitates the use of the bug through the code (a.log.debug(), ...)
  • consolidates all client logs to 'serenade.log' to make easer understanding and cross-relating
  • debug log toggling is done by setting verbose on settings

A sample of the logs can be seen here: https://gist.github.com/sombrafam/9daf57e9ea86106499494b03b01dba2a

Test Plan

This change was tested manually. I compiled the changes, make sure that verbose was configured=true in the interface,
And checked 'serenade.log' to see if the new logging format was used. I have been using my local built version all morning without any problem with everything working fine.

Pre-Review Checklist

[ X ] I've performed a self-review of my own code
[ ] I've run the pre-commit hook to enforce code style (for some reason this is not triggering)
[ ] I've added or corresponding updated tests
[ ] I've run all tests and there were no failures
[ X] I've updated the documentation, if applicable

@@ -118,7 +118,7 @@ For more information, check out the Serenade API documentation: https://serenade
return new Promise((resolve) => {
this.resolveStart = resolve;
this.stop();
const stream = fs.createWriteStream(path.join(this.settings.path(), "serenade.log"));
const stream = fs.createWriteStream(path.join(this.settings.path(), "custom-command-server.log"));
Copy link
Author

Choose a reason for hiding this comment

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

I changed the name of this file to be something different from the default since this is logging for another process, and the messages would be mixed.

This commit adds  new framework for logging  across modules.
It allows amongst other things:

- several levels of logging  (ERROR, WARNING, INFO, DEBUG)
- adds time stamping
- facilitates the use of the bug through the code (a.log.debug(), ...)
- consolidates all client logs to 'serenade.log' to make easer
  understanding and cross-relating
- debug log toggling is done by setting verbose on settings
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.

1 participant
0