Skip to content
This repository was archived by the owner on Sep 28, 2018. It is now read-only.

Logging to stderr (usage of debug) #5

Open
voldern opened this issue Nov 25, 2015 · 3 comments
Open

Logging to stderr (usage of debug) #5

voldern opened this issue Nov 25, 2015 · 3 comments

Comments

@voldern
Copy link

voldern commented Nov 25, 2015

I've started to quickly skim through the code, and looking here https://github.com/vgno/roc-web/blob/master/src/app/server/index.js#L72 I see that you use debug for logging.

By default debug uses stderr (console.error) as the output source. The message in the example above is not an error but information, so it should be outputted to stdout.

You can either fix this by following this explanation or by using a more fully featured logging library like bunyan if you're going to do a lot of logging.

@voldern voldern changed the title Use of logging library Logging to stderr (usage of debug) Nov 25, 2015
@andreasrs
Copy link
Contributor

Thanks a lot for the feedback. We'll be looking at this.
Do you have any experience with bunyan in isomorphic/universal apps btw? I believe it can probably be bundled for clients, but it may be a bit bloated. Experiences welcome.

@voldern
Copy link
Author

voldern commented Dec 2, 2015

I've never tried it on the frontend, but according to https://github.com/trentm/node-bunyan it supports browserify/webpack. So the question then is the code size and if there is a need for it on the frontend.

Looking at https://github.com/trentm/node-bunyan/blob/master/lib/bunyan.js it doesn't seem to be very large if its minified.

@dlmr
Copy link
Contributor

dlmr commented Dec 2, 2015

I think the advisable thing to do here is to use both since some of the packages that we use support debug internally. Need to look more into this, it might be the case that bunyan can manage this for us as well.

The size of bunyan should not be a problem since we only want to log in development on the client and can easily remove it from the production build.

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

No branches or pull requests

3 participants