Browse Source

Use WARNING instead of deprecated WARN, fix log level alignment

pull/1333/head
Ross McFarland 3 weeks ago
parent
commit
0163353da6
No known key found for this signature in database GPG Key ID: 943B179E15D3B22A
3 changed files with 9 additions and 4 deletions
  1. +4
    -0
      .changelog/45575dea1d2949f58fc7989a5a57d4b5.md
  2. +2
    -1
      octodns/cmds/args.py
  3. +3
    -3
      octodns/provider/plan.py

+ 4
- 0
.changelog/45575dea1d2949f58fc7989a5a57d4b5.md View File

@ -0,0 +1,4 @@
---
type: patch
---
Use WARNING instead of deprecated WARN, fix log level alignment

+ 2
- 1
octodns/cmds/args.py View File

@ -73,7 +73,8 @@ class ArgumentParser(_Base):
# configuration
return
fmt = '%(asctime)s [%(thread)d] %(levelname)-5s %(name)s %(message)s'
# 7 is the length of the largest logging level, warning, that we're concerned with aligning.
fmt = '%(asctime)s [%(thread)d] %(levelname)-7s %(name)s %(message)s'
formatter = Formatter(fmt=fmt, datefmt='%Y-%m-%dT%H:%M:%S ')
stream = stdout if args.log_stream_stdout else stderr
handler = StreamHandler(stream=stream)


+ 3
- 3
octodns/provider/plan.py View File

@ -5,7 +5,7 @@
from collections import defaultdict
from io import StringIO
from json import dumps
from logging import DEBUG, ERROR, INFO, WARN, getLogger
from logging import DEBUG, ERROR, INFO, WARNING, getLogger
from pprint import pformat
from sys import stdout
@ -152,8 +152,8 @@ class PlanLogger(_PlanOutput):
self.level = {
'debug': DEBUG,
'info': INFO,
'warn': WARN,
'warning': WARN,
'warn': WARNING,
'warning': WARNING,
'error': ERROR,
}[level.lower()]
except (AttributeError, KeyError):


Loading…
Cancel
Save