mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-02-17 07:03:58 +00:00
Do not re-write the log file if already exists. Add a log handler in "append" mode (that should be an implicit value but it's defined explicitly for the visibility).
This commit is contained in:
@@ -1179,9 +1179,7 @@ def _main():
|
||||
logger.setLevel(logging.DEBUG)
|
||||
if opts.log_file:
|
||||
try:
|
||||
log_file = open(opts.log_file, "w")
|
||||
log_file.close()
|
||||
fh = logging.FileHandler(opts.log_file)
|
||||
fh = logging.FileHandler(opts.log_file, "a")
|
||||
formatter = logging.Formatter(
|
||||
"%(asctime)s - "
|
||||
"%(levelname)s - [%(filename)s:%(lineno)d] - %(message)s"
|
||||
|
||||
Reference in New Issue
Block a user