Navigation Menu

Skip to content

Commit

Permalink
Normalize Serf log level for Droonga's logger
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 28, 2014
1 parent f038632 commit bb13da1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/droonga/serf.rb
Expand Up @@ -290,7 +290,8 @@ def on_standard_output(line_buffer, data)
hour, minute, second = $4, $5, $6
level = $7
content = $POSTMATCH
logger.send(level.downcase, content)
level = normalize_level(level)
logger.send(level, content)
else
logger.info(content)
end
Expand All @@ -300,6 +301,16 @@ def on_standard_output(line_buffer, data)
end
end

def normalize_level(level)
level = level.downcase
case level
when "err"
"error"
else
level
end
end

def on_error_output(line_buffer, data)
line_buffer.feed(data) do |line|
line = line.chomp
Expand Down

0 comments on commit bb13da1

Please sign in to comment.