deno_std
deno_std copied to clipboard
BREAKING(log): change `setup` and `destroy`
Ref: https://github.com/denoland/std/issues/4391
Changes
This PR remove the setup() and destroy() methods from BaseHandler.
It removes the setup() and destroy() method calls in the setup() function.
~It makes BaseHandler and log() abstract.~
It adds a check whether the file is open when log() is called. If not, it opens it.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 96.23%. Comparing base (
c8fe634) to head (5253751). Report is 7 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #5701 +/- ##
==========================================
- Coverage 96.23% 96.23% -0.01%
==========================================
Files 480 480
Lines 38743 38736 -7
Branches 5616 5616
==========================================
- Hits 37286 37279 -7
Misses 1416 1416
Partials 41 41
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I'm not in favor of this change. This doesn't solve anything, but changes things in breaking way, based on aesthetic reason/naming preference.
I'm not in favor of this change. This doesn't solve anything, but changes things in breaking way, based on aesthetic reason/naming preference.
Well, it removes the necessity of having the setup and destroy functions at all and thus simplifies the api.
Renaming them in the FileHandler to open() and close() describes what they do better imo.
Are you not in favour of both or just one of these changes?
I'm not in favor of either.
it removes the necessity of having the setup and destroy functions at all and thus simplifies the api.
I don't understand this. It gives the default (empty) implementation. The inherited classes don't need to implement them.
I'm not in favor of either.
it removes the necessity of having the setup and destroy functions at all and thus simplifies the api.
I don't understand this. It gives the default (empty) implementation. The inherited classes don't need to implement them.
What I mean is that users can use the constructor() as a setup() function and dispose() as a destroy() function. There is no need for api specific functions.
I understand both the reasons for and against this change. However, I'll close this without merge as I think the method names are fine as-is.