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

Logger invocations should use progname #26

Closed
rhettc opened this issue Apr 2, 2014 · 4 comments
Closed

Logger invocations should use progname #26

rhettc opened this issue Apr 2, 2014 · 4 comments

Comments

@rhettc
Copy link

rhettc commented Apr 2, 2014

We use a consolidated logging 'system' so the ability to parse out one lib's messages from another is important to us. And while most of your messages start with Pubnub, not all do. That leaves me without a good way to isolate PubNub messages from others.

The Logger class has an alternate way to pass in the args when logging a message. Please consider invoking the logger methods in the way that includes program name (prognam). Extracting relevant bits from the stdlib docs below:

Signature:

info(progname, &block)

Arguments:

progname
In the block form, this is the progname to use in the log message.
block
Evaluates to the message to log. This is not evaluated unless the logger’s level is sufficient to log the message. This allows you to create potentially expensive logging messages that are only called when the logger is configured to show them.

$logger.debug('Pubnub::Client#start_subscribe | Override')
# could become
$logger.debug('PubNub'){'Pubnub::Client#start_subscribe | Override'}

http://ruby-doc.org/stdlib-2.1.1/libdoc/logger/rdoc/Logger.html#method-i-info

@blazeroot
Copy link
Contributor

Hi @rhettc! Thanks for suggestion! I'm sure we will shortly refactor all .debug to pass progname parameter. I'll keep you updated here.

@rhettc
Copy link
Author

rhettc commented Apr 2, 2014

Thanks @blazeroot, I look forward to it

@rhettc rhettc closed this as completed Apr 2, 2014
@rhettc rhettc reopened this Apr 2, 2014
@rhettc
Copy link
Author

rhettc commented Apr 2, 2014

^ Ooops sorry about the state change. misclick!

@blazeroot
Copy link
Contributor

Fixed in current develop, will be merged into master.

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

No branches or pull requests

2 participants