]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Merge commit 'pull/origin/2506'
authorBen Darnell <ben@bendarnell.com>
Sat, 20 Oct 2018 14:16:28 +0000 (10:16 -0400)
committerBen Darnell <ben@bendarnell.com>
Sat, 20 Oct 2018 14:16:28 +0000 (10:16 -0400)
1  2 
tornado/log.py

diff --cc tornado/log.py
index 2ac2e4678563362bae04c69dad0a4af967ff0bae,1bb6f9571c2fa04aaf2dc2d371fde4955e640b35..435cd718580b54528da8122043fed3a055694901
@@@ -229,19 -221,17 +229,21 @@@ def enable_pretty_logging(options: Any 
                  filename=options.log_file_prefix,
                  maxBytes=options.log_file_max_size,
                  backupCount=options.log_file_num_backups,
 -                encoding="utf-8")  # type: logging.Handler
 -        elif rotate_mode == 'time':
++                encoding="utf-8",
 +            )  # type: logging.Handler
 +        elif rotate_mode == "time":
              channel = logging.handlers.TimedRotatingFileHandler(
                  filename=options.log_file_prefix,
                  when=options.log_rotate_when,
                  interval=options.log_rotate_interval,
                  backupCount=options.log_file_num_backups,
 -                encoding="utf-8")
++                encoding="utf-8",
 +            )
          else:
 -            error_message = 'The value of log_rotate_mode option should be ' +\
 -                            '"size" or "time", not "%s".' % rotate_mode
 +            error_message = (
 +                "The value of log_rotate_mode option should be "
 +                + '"size" or "time", not "%s".' % rotate_mode
 +            )
              raise ValueError(error_message)
          channel.setFormatter(LogFormatter(color=False))
          logger.addHandler(channel)