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

Improve logging reliability and fix export consistency issues #35

Merged
merged 3 commits into from
Aug 22, 2024

Conversation

mitsuki31
Copy link
Owner

Overview

This pull request addresses several issues related to logging reliability and export inconsistencies. The changes focus on ensuring that errors are logged appropriately and that the exported members are correctly named for consistent usage.

Key Changes

Fixes

  • 925ceec - Ensure that logging is done before exit:
    • Updated the writeErrorLog function to include a promise chain that ensures logging completes before the function exits. This prevents any race conditions and ensures that error logs are reliably recorded before the error is handled.
  • b0f04e8 - Replace the logging method:
    • Replaced the direct use of process.std*.write with the utils.logger methods in the validateYTURL function. This change improves logging control and makes the logging process more reliable and consistent with the rest of the codebase.
  • 443f627 - Fix mismatch in exported members' names:

Summary

These fixes are essential for maintaining the stability and reliability of the ytmp3 module, particularly in error handling and logging processes.

* Added a promise chain on `writeErrorLog` call to ensure the logging was completed before function exit and reject the error
* Replaced the logging method in `validateYTURL` function to use `utils.logger.*` instead `process.std*.write` for better logging control and reliable use
This issue has been around since change #33 and I forgot to resolve it while reviewing the PR. Sorry for the inconvenience.
@mitsuki31 mitsuki31 added refactor Refactor and enhancement changes bugfix Fixes any issue and bug patch Patch changes labels Aug 22, 2024
@mitsuki31 mitsuki31 self-assigned this Aug 22, 2024
@mitsuki31 mitsuki31 merged commit ef5c55c into master Aug 22, 2024
9 checks passed
@mitsuki31 mitsuki31 deleted the fix/improve-logging-and-exports-consistency branch August 22, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes any issue and bug patch Patch changes refactor Refactor and enhancement changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant