Be able to select log level #3

Closed
Almad opened this Issue Apr 19, 2012 · 14 comments

Comments

Projects
None yet
4 participants

Almad commented Apr 19, 2012

No description provided.

Owner

mattrobenolt commented Apr 19, 2012

I've definitely thought about this for sure, but Node doesn't have any real solid log levels unless I tapped into console.*.

Did you have any ideas? I'm open to hearing what you're doing and how you'd expect that to work.

Almad commented Apr 20, 2012

I would simply add log level as next parameter for capture method.

Owner

mattrobenolt commented Apr 20, 2012

No, I understand that. My concern is, where is the logging coming from? Node itself doesn't have traditional logging like other languages do. All logging is from other third party libraries.

Almad commented Apr 20, 2012

From nowhere; I would not replicate/rely on any logging framework, but just support explicit logging to raven with loggingLevel parameter.

Owner

mattrobenolt commented Apr 20, 2012

I get log levels and logging all around. I really do.

I just don't know how this would be done in Node since log levels don't exist. Can you provide a use case example? Maybe I'm missing something.

Almad commented Apr 20, 2012

@mattrobenolt I thought logLevels would be just exported as constants, or that integers could be provided. Are they not internal representation in most logging frameworks anyway?

Like in Python, http://docs.python.org/howto/logging.html#logging-levels (not that Python logging is neat, but for the sake of an example...).

And maybe, some convenience wrapper may be provided, so instead of captureMessage, I could send captureWarning or captureDebug.

Owner

mattrobenolt commented Apr 20, 2012

No, like I've said, Node doesn't have log levels or any form of logging built in besides console.

I've done a little research into making adapters for some third party logging libraries but haven't come up with a good consensus yet.

Almad commented Apr 20, 2012

@mattrobenolt I am somehow still confused. I thought we are talking only about logging levels that are send to sentry...?

Owner

mattrobenolt commented Apr 20, 2012

Oh, I think I get what you're saying now. You want me to add methods on raven to implement my own logging and log levels. Then only send logs that are higher than the level declared. Correct? If so, that sounds reasonable.

Almad commented Apr 20, 2012

@mattrobenolt Yup, correct. It will help a lot.

kof commented May 18, 2012

Another similar thing:

captureError, captureMessage and captureQuery doesn't set a default level, so UI shows also info messages as level=error.

Owner

mattrobenolt commented May 18, 2012

@Almad @kof Let me get back into this. I've been in hiatus for a bit between moving and getting caught up on real work. I'll take a new look at this this weekend and see what the options in Sentry are for sending log levels and whatnot. :)

kof commented May 24, 2012

Already found the description of json format

http://sentry.readthedocs.org/en/latest/developer/client/index.html#building-the-json-packet

We are already able to set levels just by settings level property in second param

        client.captureMessage('Message', {level: 'info'});

kof added a commit to skimcom/raven-node that referenced this issue May 25, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment