You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I decided I wanted to move over to RotatingFileHandler for log file rotation. My previous setup no longer works because RotatingFileHandler.setup is async whereas FileHandler.setup is sync, so this requires me to refactor all my classes if I want to use it.
Describe the solution you'd like
Make the API consistent for log handlers, either all async or all sync.
IMO there could have been setup & setupSync like other Deno APIs but this probably can't be changed while preserving backwards compatibility.
Alternatively add a SyncRotatingFileHandler that can be used in sync contexts
The text was updated successfully, but these errors were encountered:
Looking into this a bit it looks like RotatingFileHandler.setup being async might be an oversight, it appears the log.setup method was made sync a while ago ebeecac
Is your feature request related to a problem? Please describe.
When creating logger handlers some of the handler setup functions are
sync
while others areasync
.For example, I have a function that creates a logger for my modules like so:
That I was using in the constructor of my modules:
I decided I wanted to move over to
RotatingFileHandler
for log file rotation. My previous setup no longer works becauseRotatingFileHandler.setup
is async whereasFileHandler.setup
is sync, so this requires me to refactor all my classes if I want to use it.Describe the solution you'd like
Make the API consistent for log handlers, either all async or all sync.
IMO there could have been
setup
&setupSync
like other Deno APIs but this probably can't be changed while preserving backwards compatibility.Alternatively add a
SyncRotatingFileHandler
that can be used insync
contextsThe text was updated successfully, but these errors were encountered: