Lines Matching refs:logging
2 Autotest has some surprisingly complicated logging behaviour.
4 Managers allow you to define logging contexts, which define a set of rules on
7 wish to temporarily change how logging works, this gives you that mechanism.
10 fork-for-a-logging-subprocess ordeal that's better explained as
12 normal python logging
17 | +------stdout---->+LOGGING|
29 ||logging.info('')|| ||logging.info('')||
34 logging subprocess, and set its stdout/stderr fd's to the subprocess's stdin.
39 python logging in a very consistent way.
43 import fcntl, logging, os, signal, sys, warnings
49 Configure the logging module using the specific configuration object, which
80 logger = logging.getLogger()
91 """Decorator to annotate functions we will tell logging not to log."""
98 # Copied from Python 2.4 logging/__init__.py Logger.findCaller and enhanced.
99 # The logging code remains the same and compatible with this monkey patching
111 if filename == logging._srcfile:
129 # Monkey patch our way around logging's design...
130 _original_logger__find_caller = logging.Logger.findCaller
131 logging.Logger.findCaller = _logging_manager_aware_logger__find_caller
136 File-like object that will receive messages pass them to the logging
146 def __init__(self, prefix='', level=logging.DEBUG):
176 Passes lines of output to the logging module.
178 logging.log(self._level, self._prefix + line)
210 the logging module by replacing the file objects with a new LoggingFile
211 that calls logging.log().
240 """Start directing the stream to the logging module."""
251 Called when the logging manager is about to push a new context onto the
252 stack and has changed logging settings. The StreamHandler can modify
260 Called when the logging manager is restoring a previous context.
268 Manages a stack of logging configurations, allowing clients to conveniently
269 add and remove logging destinations. Also keeps a list of StreamManagers
270 to easily direct streams into the logging module.
288 # * old_handlers: list of registered logging Handlers
298 stream will be directed to the logging module instead. Must be called
319 self.manage_stream(sys.stdout, logging.INFO,
330 Begin capturing output to the logging module.
372 Modify the logging module's registered handlers and push a new context
374 @param add_handlers_fn: function to modify the registered logging
385 class _TaggingFormatter(logging.Formatter):
407 @param clear_other_handlers - if true, clear out all other logging
466 # restore logging handlers
492 this will hang waiting for the logging
513 input to the logging module, and we point the FD to that subprocess. As a
515 pick up the new logging settings (without disturbing any existing processes
516 using the old logging subprocess).
540 point logging StreamHandlers that point to this stream to a safe
542 to the logging subprocess, effectively getting doubly logged.
551 """ point logging StreamHandlers back to the original FD """
559 Redirect all configured logging StreamHandlers pointing to
563 points_to_stream = (isinstance(handler, logging.StreamHandler) and
570 new_handler = logging.StreamHandler(new_stream)
590 Spawn a subprocess to log all input to the logging module with the
613 logging.exception('Logging subprocess died:')
621 logging module until EOF.
626 logging.log(self._level, line.rstrip('\n'))
627 logging.debug('Logging subprocess finished')
639 # * child_pid: PID of the logging subprocess launched
655 logging.exception('Failed to cleanly shutdown logging subprocess:')
673 # spawn the initial logging subprocess