lib/kafo/puppet_log_parser.rb in kafo-5.1.0 vs lib/kafo/puppet_log_parser.rb in kafo-6.0.0
- old
+ new
@@ -6,18 +6,24 @@
def parse(line)
method, message = case
when line =~ /^Error:(.*)/i || line =~ /^Err:(.*)/i
[:error, $1]
- when line =~ /^Warning:(.*)/i || line =~ /^Notice:(.*)/i
- [:warn, $1]
- when line =~ /^Info:(.*)/i
+ when line =~ /^Notice:(.*)/i
[:info, $1]
- when line =~ /^Debug:(.*)/i
+ when line =~ /^Warning:(.*)/i || line =~ /^Debug:(.*)/i || line =~ /^Info:(.*)/i
[:debug, $1]
else
[@last_level.nil? ? :info : @last_level, line]
end
+
+ if message.include?('Loading facts') && method != :error
+ method = :debug
+ end
+
+ if message.include?('Applying configuration version')
+ method = :debug
+ end
@last_level = method
return [method, message.chomp.strip]
end
end