chore(log): rework std/log to work without deprecated Deno.Writer - #4021
Merged
Conversation
12 tasks
iuioiua
reviewed
Dec 24, 2023
iuioiua
suggested changes
Dec 28, 2023
Contributor
Author
|
Sure, TS private keyword or JS hash prefix?
|
Contributor
|
Hash prefix please 🙂 |
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Contributor
Author
|
All suggestions applied 🙏 ready for another review 🎉 |
std/log to work without deprecated Deno.Writer
iuioiua
approved these changes
Dec 28, 2023
iuioiua
left a comment
Contributor
There was a problem hiding this comment.
Great work! Thank you for this.
This was referenced Dec 28, 2023
33 tasks
|
Hi! With this attempt to log circa 4096 octets message just dumps the process. import { RotatingFileHandler } from "https://deno.land/std@0.217.0/log/mod.ts"
const logger = new RotatingFileHandler(
"DEBUG",
{
filename: "/tmp/123",
maxBytes: 4000000,
maxBackupCount: 10,
},
)
logger.log("x".repeat(4096)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Attempting to solve #3907
Previous attempt of #3969 was trying to use
std/streams/buffer.tsand the streams API, but moving to async flushes resulted in potentially lost logs.Now just solving with a
Uint8Arrayand aArrayBufferand a number pointer.