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

Add logging #150

Open
k3KAW8Pnf7mkmdSMPHz27 opened this issue Aug 11, 2021 · 1 comment
Open

Add logging #150

k3KAW8Pnf7mkmdSMPHz27 opened this issue Aug 11, 2021 · 1 comment
Labels
p1: chore Not essential, e.g. (code) cleanup type: developer experience

Comments

@k3KAW8Pnf7mkmdSMPHz27
Copy link
Member

Perhaps we should add "no-console": "off", to the eslint rules. I am interested in opinions, particularly if there is a better approach for debugging here. Based on that "Runtime logging delivers console.log statements to a separate log file you create to help you uncover issues. I'd say it seems the official approach.

Off-topic:
Instructions for starting runtime logging

@k3KAW8Pnf7mkmdSMPHz27 k3KAW8Pnf7mkmdSMPHz27 changed the title Make it console.log official for debugging purposes? Make use of console.log official for debugging purposes? Aug 11, 2021
@tobiasdiez
Copy link
Member

tobiasdiez commented Aug 11, 2021

Some form of logging is of course nice for development. The problem with console.log is that you cannot disable it in production, where you don't want to flood the console view but only print errors.

The solution is to use a logging library. I don't have much experience/opinion here, but https://www.npmjs.com/package/debug and https://www.npmjs.com/package/loglevel are the most-used ones. I also came across https://www.npmjs.com/package/ulog which seems to be a nice modern hybrid, but it is way less used. Maybe give it a shot nonetheless if it works than it works?

https://www.npmtrends.com/js-logger-vs-log4js-vs-loglevel-vs-morgan-vs-pino-vs-winston-vs-ulog

@k3KAW8Pnf7mkmdSMPHz27 k3KAW8Pnf7mkmdSMPHz27 changed the title Make use of console.log official for debugging purposes? Add logging Aug 12, 2021
@tobiasdiez tobiasdiez added p1: chore Not essential, e.g. (code) cleanup type: developer experience labels Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1: chore Not essential, e.g. (code) cleanup type: developer experience
Projects
None yet
Development

No branches or pull requests

2 participants