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

Find a multilevel logger framework #6

Open
kjetilk opened this issue Nov 13, 2018 · 6 comments
Open

Find a multilevel logger framework #6

kjetilk opened this issue Nov 13, 2018 · 6 comments
Labels
help wanted Extra attention is needed inrupt-planning Issues that Inrupt will consider when planning development cycles priority-high

Comments

@kjetilk
Copy link
Member

kjetilk commented Nov 13, 2018

This module uses mostly console.log and is pretty chatty. We need to use a logger framework with at least info, debug and trace levels.

We should pick something that could be brought to v.next too, and so it should have more levels than that, be maintained and in common use, integrate well with test runs (so that different levels can be chosen directly on the command line), and be easy for people to set loglevels if they need help debugging stuff.

@kjetilk kjetilk added help wanted Extra attention is needed inrupt-planning Issues that Inrupt will consider when planning development cycles priority-high labels Nov 13, 2018
@kjetilk kjetilk changed the title Find a multilevel debug framework Find a multilevel logger framework Nov 13, 2018
@RubenVerborgh
Copy link

Note: NSS currently uses the debug module (used by Express as well).

@kjetilk
Copy link
Member Author

kjetilk commented Nov 14, 2018

Yeah, but that doesn't appear to have multiple levels, which I feel makes it unusable for this kind of project. Or does it?

@RubenVerborgh
Copy link

It does not, and it's a good counterargument.

@Ryuno-Ki
Copy link

Check out nodeSolidServer/node-solid-server#920 - I suggested loglevel and winston there. loglevel is quite easy to use, whereas winston is quite sophisticated.

As starter I'd move the logging logic into a dedicated file, so you can exchange the logic there if needed (even if that module is just a proxy to console.log in the beginning).

@kjetilk
Copy link
Member Author

kjetilk commented Nov 30, 2018

@Ryuno-Ki do you know if loglevel is async?

I'd like to keep quite a lot of logging statements in, as I have found that it helps in projects like ours when people report problems, we can ask them to turn their log level up and try again. But then, it becomes really important that logging isn't occupying more than necessary of resources.

@Ryuno-Ki
Copy link

Ryuno-Ki commented Jan 5, 2019

@kjetilk From reading the source code I'd say it is synchronous: https://github.com/pimterry/loglevel/blob/master/lib/loglevel.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed inrupt-planning Issues that Inrupt will consider when planning development cycles priority-high
Projects
None yet
Development

No branches or pull requests

3 participants