Commits

Michael Granger committed 040bb1a

Downcase the severity before outputting.

  • Participants
  • Parent commits cc5441f

Comments (0)

Files changed (3)

File lib/loggability/formatter.rb

 			time.usec,                                                    # %2$d
 			Process.pid,                                                  # %3$d
 			Thread.current == Thread.main ? 'main' : Thread.object_id,    # %4$s
-			severity,                                                     # %5$s
+			severity.downcase,                                            # %5$s
 			progname,                                                     # %6$s
 			self.msg2str(message, severity)                               # %7$s
 		]

File spec/loggability/formatter_spec.rb

 	it "formats messages with the pattern it's constructed with" do
 		formatter = Loggability::Formatter.new( '[%5$s] %7$s' )
 		formatter.call( 'INFO', Time.at(1336286481), nil, 'Foom.' ).should =~
-			/\[INFO\] Foom./
+			/\[INFO\] Foom./i
 	end
 
 	it "formats exceptions into useful messages" do

File spec/loggability/logger_spec.rb

 			proxy.error( "An error message." )
 			proxy.fatal( "A fatal message." )
 
-			messages.first.should =~ /DEBUG \{Object:0x[[:xdigit:]]+\} -- A debug message.\n/
+			messages.first.should =~ /DEBUG \{Object:0x[[:xdigit:]]+\} -- A debug message.\n/i
 		end
 
 		it "has a terse inspection format" do