mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
18 lines
No EOL
665 B
Python
18 lines
No EOL
665 B
Python
from djangologging import SUPPRESS_OUTPUT_ATTR
|
|
|
|
|
|
def suppress_logging_output(func=None):
|
|
"""
|
|
Decorates a view to prevent any log messages generated by it (or anything
|
|
it calls) from being outputted to the browser.
|
|
"""
|
|
def decorated(*args, **kwargs):
|
|
response = func(*args, **kwargs)
|
|
setattr(response, SUPPRESS_OUTPUT_ATTR, True)
|
|
return response
|
|
return decorated
|
|
|
|
def supress_logging_output(func=None):
|
|
import warnings
|
|
warnings.warn('supress_logging_output is deprecated and will be removed soon; use the correctly spelled version instead: suppress_logging_output.')
|
|
return suppress_logging_output(func) |