Loggers should accept both numbers and symbols (#6967)

Merge pull request 6967
This commit is contained in:
Pat Hawks 2018-05-01 07:37:45 -05:00 committed by jekyllbot
parent e00c8c72e9
commit 9461c900c0
1 changed files with 3 additions and 1 deletions

View File

@ -29,7 +29,9 @@ module Jekyll
# #
# Returns nothing # Returns nothing
def log_level=(level) def log_level=(level)
writer.level = LOG_LEVELS.fetch(level) writer.level = level if level.is_a?(Integer) && level.between?(0, 3)
writer.level = LOG_LEVELS[level] ||
raise(ArgumentError, "unknown log level")
@level = level @level = level
end end