Skip to content

Commit 0d32fd3

Browse files
committed
optimize debug logging if undesired
1 parent ddfc808 commit 0d32fd3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

eval.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@
2323
logger.info('init')
2424

2525

26+
DEBUG = False
27+
28+
# debug logging in this module is actually quite expensive (> 30 % of time). In
29+
# case it's undesired the following removes that overhead.
30+
if not DEBUG:
31+
# noinspection PyUnusedLocal
32+
def quick_skip_debug_log(*args, **kwds):
33+
pass
34+
logger.debug = quick_skip_debug_log
35+
36+
2637
def pattern_generator(
2738
length,
2839
loops=True,

0 commit comments

Comments
 (0)