Skip to content

Commit

Permalink
Only inspect non-string messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Hunt committed Jan 4, 2014
1 parent 12af39b commit 562f401
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/hi/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
module Hi
class Logger
def log(message)
ap message unless testing
print message unless testing
end

private

def print(message)
if message.is_a? String
puts message
else
ap message
end
end

def testing
ENV['RACK_ENV'] == 'test'
end
Expand Down

0 comments on commit 562f401

Please sign in to comment.