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

Remove logging framework #6124

Open
vwkd opened this issue Oct 17, 2024 · 3 comments
Open

Remove logging framework #6124

vwkd opened this issue Oct 17, 2024 · 3 comments

Comments

@vwkd
Copy link
Contributor

vwkd commented Oct 17, 2024

I'd suggest to remove the log module.

It isn't cross platform compatible, has the lowest JSR score of all @std packages with 88%, and is still unstable. The API has not evolved since originally porting it from Go, the API doesn't really fit JavaScript with magical global state that's influenced by the setup function, which the user must take care to always call first before any implementing library.

It's the only framework in the standard library. There are different ways to do a framework and not one best solution. There are various third-party frameworks, often better maintained and cross platform. Frameworks aren't a good fit for a standard library.

It's why a HTTP framework wasn't added multiple times #144 (comment) #1555 (comment). Related #1295.

@iuioiua
Copy link
Contributor

iuioiua commented Oct 19, 2024

I agree. I very much dislike @std/log. Discussions with Yoshiya (when I maintained this project) aligned with replacing the entire package with something better.

@halvardssm
Copy link
Contributor

I partially agree, I don’t mind the logger changing, but I am finding it very useful to have a standard logger library that can log to the console, a file and whatever pluggable custom logger I would find or make.

@BlackAsLight
Copy link
Contributor

I am in favour of it being changed instead of removed. I'm not 100% familiar with how it works, but things I'd like to see in a logging framework is:

  • The ability for libraries to implement it in their code that doesn't add additional computational strait if the main module isn't using it.
    • This could maybe be archived though accepting simple types in log.debug() or any type that implements a custom symbol like Symbol.Log, where calling the symbol on the object will have it handle how to stringify the object.
  • For the main module to decide completely how the output of the logger is displayed instead of opting for JSON.
  • A cron like expression that triggers to allow rotation of where the logs are going. For example if it's going to a file, lets one switch to a new file after x hours.
  • Many of the settings for the main module be configured via environment variables. This can remove people's disdain for the need to call log.setup() Like:
    • Default level being logged.
    • Library specific level being logged.
    • Location the logs are logged: "stdout", "stderr", a directory/file name, "null", or let runtime code decide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants