Skip to content

Commit

Permalink
Cut off one more String allocation
Browse files Browse the repository at this point in the history
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
  • Loading branch information
2 people authored and ioquatix committed Dec 8, 2022
1 parent 9af9103 commit bd28656
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/logger/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Logger
# Default formatter for log messages.
class Formatter
Format = "%s, [%s #%d] %5s -- %s: %s\n"
Format = "%.1s, [%s #%d] %5s -- %s: %s\n"
DatetimeFormat = "%Y-%m-%dT%H:%M:%S.%6N"

attr_accessor :datetime_format
Expand All @@ -13,7 +13,7 @@ def initialize
end

def call(severity, time, progname, msg)
sprintf(Format, severity[0, 1], format_datetime(time), Process.pid, severity, progname, msg2str(msg))
sprintf(Format, severity, format_datetime(time), Process.pid, severity, progname, msg2str(msg))
end

private
Expand Down

0 comments on commit bd28656

Please sign in to comment.