Created
May 8, 2013 14:12
-
-
Save ThiefMaster/5540706 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DebugLevelFilter(Filter): | |
max_debug_level = None | |
def __init__(self, required_level): | |
super(DebugLevelFilter, self).__init__() | |
self.required_level = required_level | |
def input(self, in_, out, **kw): | |
if self.required_level == self.env.debug: | |
out.write(in_.read()) | |
else: | |
skip_msg = '/* Skipped {} because of debug level */'.format(os.path.basename(kw['source_path'])) | |
out.write(skip_msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment