Skip to content

Commit

Permalink
dist logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Andriy Brukhovetskyy committed May 7, 2024
1 parent be90339 commit 15e7642
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions utils/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,11 @@ def init_logging(debug=False):
formatter = logging.Formatter("%(asctime)s %(levelname)s:%(module)s:%(threadName)s - %(message)s")
log = logging.getLogger()

for h in log.handlers[:]:
if isinstance(h, logging.StreamHandler) and h.stream == sys.stderr:
log.removeHandler(h)
h.close()

if not path_exists(os.path.join(CUCKOO_ROOT, "log")):
path_mkdir(os.path.join(CUCKOO_ROOT, "log"))
fh = handlers.TimedRotatingFileHandler(os.path.join(CUCKOO_ROOT, "log", "dist.log"), when="midnight", backupCount=10)
Expand Down

0 comments on commit 15e7642

Please sign in to comment.