Skip to content

Commit

Permalink
Merge pull request #17 from jlambert121/issue_12
Browse files Browse the repository at this point in the history
attempt at fixing issue 12
  • Loading branch information
jordansissel committed Jul 22, 2013
2 parents de40708 + 37ab014 commit 8db8f59
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/cabin/outputs/stdlib-logger.rb
@@ -1,7 +1,7 @@
require "cabin"

# Wrap Ruby stdlib's logger. This allows you to output to a normal ruby logger
# with Cabin. Since Ruby's Logger has a love for strings alone, this
# with Cabin. Since Ruby's Logger has a love for strings alone, this
# wrapper will convert the data/event to ruby inspect format before sending it
# to Logger.
class Cabin::Outputs::StdlibLogger
Expand All @@ -17,7 +17,11 @@ def <<(event)
if !event.include?(:level)
event[:level] = :info
end
method = event[:level].downcase.to_sym || :info
if event[:level].is_a?(Symbol)
method = event[:level]
else
method = event[:level].downcase.to_sym || :info
end
event.delete(:level)

data = event.clone
Expand Down

0 comments on commit 8db8f59

Please sign in to comment.