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

Modified syntax of logging methods according to those of Logger class #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

codeout
Copy link

@codeout codeout commented Mar 24, 2012

Updated methods below so that

debug('progname'){ 'message' }

can generate a syslog like

Mar 24 17:21:09 my_mac rails[17421]: [17:21:09.650780 ] [DEBUG]: message

instead of

Mar 24 17:21:09 my_mac rails[17421]: [17:21:09.650780 ] [DEBUG]: progname
  • unkown()
  • fatal()
  • error()
  • warn()
  • info()
  • debug()

According to API (eg: http://www.ruby-doc.org/stdlib-1.9.3/libdoc/logger/rdoc/Logger.html#method-i-debug)

'debug' looks like:

def debug(progname = nil, &block)
  add(DEBUG, nil, progname, &block)
end

not

def debug(message = nil, progname = nil, &block)
  add(DEBUG, message, progname, &block)
end

My changes are tested with ruby 1.8.7-p358, 1.9.2-p318 and 1.9.3-p125.

thanks

… class.

- unkown()
- fatal()
- error()
- warn()
- info()
- debug()
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

Successfully merging this pull request may close these issues.

1 participant