Skip to content

Commit

Permalink
log filename convention + rolling logs limited to 5MB per fuzzer inst…
Browse files Browse the repository at this point in the history
…ance
  • Loading branch information
wintered committed Jun 1, 2021
1 parent 30c39ba commit 7d7b6d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions src/modules/Fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
import shutil
import os
import re
import datetime
import signal
import logging
from logging.handlers import RotatingFileHandler
import time


Expand Down Expand Up @@ -46,8 +48,14 @@ def __init__(self, args):
self.first_status_bar_printed = False

# Init logging
log_fn = self.args.logfolder+"/"+str(self.args.name)
logging.basicConfig(filename=log_fn,format='%(asctime)s %(message)s', datefmt='[%Y/%m/%d %I:%M:%S %p]',level=logging.DEBUG)
fn = datetime.datetime.now().strftime('yinyang-%Y-%m-%d-%M:%S-%p') + "-" + str(self.args.name) +".log"
log_fn = self.args.logfolder+"/"+ fn


logging.basicConfig(
handlers=[RotatingFileHandler(filename=log_fn, maxBytes=1024*1024, backupCount=5)],
format='%(asctime)s %(message)s', datefmt='[%Y/%m/%d %I:%M:%S %p]',level=logging.DEBUG
)
console = logging.StreamHandler()
formatter = logging.Formatter('%(asctime)s %(message)s',datefmt='[%Y/%m/%d %I:%M:%S %p]')
console.setLevel(logging.INFO)
Expand Down Expand Up @@ -272,7 +280,7 @@ def test(self, formula, i):
continue # continue with next solver (4)

elif exitcode == 127: #command not found
print("\nPlease check your solver command-line interfaces.")
# print("\nPlease check your solver command-line interfaces.")
continue # continue with next solver (4)
# TODO: there is some problem here
# self.statistic.ignored+=1
Expand Down
2 changes: 1 addition & 1 deletion src/modules/Solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def solve(self, file, timeout, debug=False):
stderr = ""
return stdout, stderr, 0
except Exception as e:
print("Solver " + cmd[0]+ " not found.")
print("Error: solver \"" + cmd[0]+ "\" not found")
exit(ERR_USAGE)


Expand Down

0 comments on commit 7d7b6d3

Please sign in to comment.