mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
logger.rb: freeze constants
* lib/logger.rb: freeze constant strings and array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0a74709e1a
commit
aeb88f01eb
1 changed files with 3 additions and 3 deletions
|
@ -208,7 +208,7 @@ class Logger
|
|||
name = File.basename(__FILE__)
|
||||
end
|
||||
rev ||= "v#{VERSION}"
|
||||
ProgName = "#{name}/#{rev}"
|
||||
ProgName = "#{name}/#{rev}".freeze
|
||||
|
||||
class Error < RuntimeError # :nodoc:
|
||||
end
|
||||
|
@ -481,7 +481,7 @@ class Logger
|
|||
private
|
||||
|
||||
# Severity label for logging (max 5 chars).
|
||||
SEV_LABEL = %w(DEBUG INFO WARN ERROR FATAL ANY)
|
||||
SEV_LABEL = %w(DEBUG INFO WARN ERROR FATAL ANY).each(&:freeze).freeze
|
||||
|
||||
def format_severity(severity)
|
||||
SEV_LABEL[severity] || 'ANY'
|
||||
|
@ -494,7 +494,7 @@ private
|
|||
|
||||
# Default formatter for log messages.
|
||||
class Formatter
|
||||
Format = "%s, [%s#%d] %5s -- %s: %s\n"
|
||||
Format = "%s, [%s#%d] %5s -- %s: %s\n".freeze
|
||||
|
||||
attr_accessor :datetime_format
|
||||
|
||||
|
|
Loading…
Reference in a new issue