feat: better (because working) logging
This commit is contained in:
parent
c922186b84
commit
108850bad0
2 changed files with 8 additions and 2 deletions
9
main.py
9
main.py
|
|
@ -34,7 +34,7 @@ def main():
|
|||
print(f"{answer=}")
|
||||
if not expected:
|
||||
expected = answer.rrset.to_text()
|
||||
print(f"set {expected=}")
|
||||
# print(f"set {expected=}")
|
||||
else:
|
||||
if answer.rrset.to_text() != expected:
|
||||
print(f"{answer.rrset.to_text()=} differs from {expected=}")
|
||||
|
|
@ -53,7 +53,12 @@ def main():
|
|||
db.query(f"""UPDATE records SET content = '{' '.join(carr)}' WHERE id={id}""")
|
||||
db.commit()
|
||||
except:
|
||||
print(f"{zone} has no DNSKEY")
|
||||
logging.error(f"{zone} has no DNSKEY")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
|
||||
datefmt='%Y-%m-%d %H:%M:%S',
|
||||
filename=config('LOG_FILENAME', './dnssec-fix.log'),
|
||||
level=config('LOG_LEVEL', 'DEBUG'))
|
||||
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue