Server IP : 85.214.239.14 / Your IP : 18.191.171.72 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/2/root/usr/lib/python3/dist-packages/setuptools/ |
Upload File : |
import sys import inspect import logging import distutils.log from . import monkey def _not_warning(record): return record.levelno < logging.WARNING def configure(): """ Configure logging to emit warning and above to stderr and everything else to stdout. This behavior is provided for compatibility with distutils.log but may change in the future. """ err_handler = logging.StreamHandler() err_handler.setLevel(logging.WARNING) out_handler = logging.StreamHandler(sys.stdout) out_handler.addFilter(_not_warning) handlers = err_handler, out_handler logging.basicConfig( format="{message}", style='{', handlers=handlers, level=logging.DEBUG) if inspect.ismodule(distutils.dist.log): monkey.patch_func(set_threshold, distutils.log, 'set_threshold') # For some reason `distutils.log` module is getting cached in `distutils.dist` # and then loaded again when patched, # implying: id(distutils.log) != id(distutils.dist.log). # Make sure the same module object is used everywhere: distutils.dist.log = distutils.log def set_threshold(level): logging.root.setLevel(level*10) return set_threshold.unpatched(level)