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

refactor(log): Deprecate BaseHandler.setup() and BaseHandler.destroy() #4435

Closed

Conversation

timreichen
Copy link
Contributor

Ref: #4391

Changes

  • Deprecates BaseHandler.setup()
  • Deprecates BaseHandler.destroy()
  • Introduces FileHandler.open() to replace FileHandler.setup()
  • Introduces FileHandler.close()to replace FileHandler.destroy()
  • Adds comments how to make setup() function work without BaseHandler.setup() and BaseHandler.destroy()

@timreichen timreichen requested a review from kt3k as a code owner March 4, 2024 07:53
@github-actions github-actions bot added the log label Mar 4, 2024
@timreichen timreichen changed the title initial commit refactor(log): Deprecate BaseHandler.setup() and BaseHandler.destroy() Mar 4, 2024
Copy link
Collaborator

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

I have a few suggestions. Also, please note that this deprecation is yet to be agreed upon. So it's possible we may not go ahead with it.

@@ -100,11 +114,4 @@ export class FileHandler extends BaseHandler {
#resetBuffer() {
this._pointer = 0;
}

override destroy() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This method should have a deprecation notice. Otherwise, this is a breaking change. We can also just call .close() within it now.

}

override setup() {
open() {
if (this.#isOpen) return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This isn't relevant to this PR. I might argue it's unnecessary, as we have the open/close status of this._file we can use instead.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please revert these changes? This ensures the legacy and possible new methods all work.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto. Can you please revert these changes?

Copy link
Collaborator

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

What if we re-orient this PR to just removing BaseHandler.setup() and BaseHandler.destroy()? That seems like a more agreeable design decision.

@iuioiua
Copy link
Collaborator

iuioiua commented May 7, 2024

@timreichen, I'm going to close this PR for now. I think we need to discuss and consider this more before proceeding. Either way, thanks for trying to push this forward.

@iuioiua iuioiua closed this May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants