Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Be able to select log level #3

Open
Almad opened this Issue · 14 comments

3 participants

@Almad

No description provided.

@mattrobenolt

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

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

@mattrobenolt

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

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

@mattrobenolt

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

@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.

@mattrobenolt

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

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

@mattrobenolt

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

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

@kof

Another similar thing:

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

@mattrobenolt

@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

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 kof referenced this issue from a commit in skimcom/raven-node
@kof kof closes #3 added documentaion about logging levels 4e8eab2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.