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

Use a better logging library #20

Open
ds300 opened this issue Apr 10, 2023 · 7 comments
Open

Use a better logging library #20

ds300 opened this issue Apr 10, 2023 · 7 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@ds300
Copy link
Owner

ds300 commented Apr 10, 2023

I copied over this log.js file from an old project of mine, but I don't love it. It also doesn't support log levels (e.g. --verbose, --debug, etc).

Let's find something better we can build on. Doesn't matter what it is as long as it's lightweight and makes life easier.

Do an audit of any log statements in the app (console.log is used in a few places too) and replace them with the new logging system.

@ds300 ds300 converted this from a draft issue Apr 10, 2023
@ds300 ds300 added the good first issue Good for newcomers label Apr 10, 2023
@igalklebanov
Copy link

igalklebanov commented Apr 10, 2023

Hey 👋

How about this? Haven't tried, looks like it ticks all the boxes.

@ds300
Copy link
Owner Author

ds300 commented Apr 10, 2023

Thanks for the suggestion! It looks good, but also looks like it's optimised for server-style logging rather than CLI-style logging?

I guess that's ok as long as it's lightweight and we can just use it for the log levels and turn off the metadata bits.

Still, I'm curious what other cli projects out there are using. npm, pnpm, yarn, etc.

@igalklebanov
Copy link

igalklebanov commented Apr 10, 2023

pnpm seems to be using bole according to this.

@judicaelandria
Copy link
Contributor

yeah, pnpm created a custom logging with bole

@ds300
Copy link
Owner Author

ds300 commented Apr 12, 2023

Vite's logger looks just like what I had in mind https://github.com/vitejs/vite/blob/cdd9c2320650f34c46e02f3777239e595cf6543d/packages/vite/src/node/logger.ts

I think we could add an extra 'verbose' log level after 'info' and take it from there

@mrkldshv
Copy link
Collaborator

I'll take this one. Will clean it up and add one more log level when porting Vite's implementation.

@mrkldshv mrkldshv self-assigned this Apr 12, 2023
@judicaelandria
Copy link
Contributor

I think #18 will depend on this one since it will use the new logging library

@ds300 ds300 moved this from 🔖 Ready to 🏗 In progress in lazyrepo road to beta Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: 🏗 In progress
Development

No branches or pull requests

4 participants