Open hexdex22 opened 3 years ago
PRs are welcome!
Horrible workaround that does reduce the amount of logger output:
In the files connection.py, errors.py and subprocess.py
Under the existing line: log = get_logger() Add the line log.info = lambda *args, **kwargs: True
This will overwrite the original log.info method.
Hope this helps.
I did it like this
from contextlib import redirect_stderr, redirect_stdout
import os
with open(os.devnull, 'w') as null_output_file:
# redirects all info- and error- level output to null
with redirect_stderr(null_output_file), redirect_stdout(null_output_file):
func_that_uses_arsenic(params)
This code significantly reduces the amount of output, though some messages, like Only local connections are allowed.
are still present in the console.
I turned down the logging level of structlog like this -
import structlog
structlog.configure(
wrapper_class=structlog.make_filtering_bound_logger(logging.ERROR),
)
The volume of logging output from this library is unbearable. A simple request outputs hundreds of lines of HTML. Real errors and messages get buried in 'INFO'
Please fix this issue or supply a simple workaround.
Have tried workarounds suggested by others and read the structlog documentation - didn't work :(
Thanks,
Raj
P.S. I'm new to programming so might have missed something.