allows more flexible and fine-grained logging, in particular
easy to add a file handler that sends DEBUG or INFO log to /tmp
attractive and clean way to add alternative formatting or more fine-grained logs (say, judgemessages or graders). This is the original motivation behind this refactoring.
decreases dependencies in verifyproblem's class structure (ideally, would get rid of ProblemAspect) by decoupling logging (log.error) from problem parts/aspects (self.get_score_range())
Why is this bad?
considerable refactoring of code
Stuff to think about before moving on:
Is this worth doing at all?
Can the attribute ProblemAspect._check_res be moved to InputValidators? Seems to be used only there.
How fine-grained should the logging hierarchy be? Currently the leaves follow the same granularity as does ProblemAspect (for instance, verifyproblem.hello.submissions), but one could go all the way down to test case or submission level verifyproblem.hello.test case group.group 3/045-huge.in or verifyproblem.hello.submissions.ac.th.py.
Moves most of the functionality from ProblemAspect into various filters, loggers, and handlers in logger.py.
Why is this good?
/tmp
ProblemAspect
) by decoupling logging (log.error
) from problem parts/aspects (self.get_score_range()
)Why is this bad?
Stuff to think about before moving on:
ProblemAspect._check_res
be moved toInputValidators
? Seems to be used only there.ProblemAspect
(for instance,verifyproblem.hello.submissions
), but one could go all the way down to test case or submission levelverifyproblem.hello.test case group.group 3/045-huge.in
orverifyproblem.hello.submissions.ac.th.py
.