def __init__(self, config, level=None): BufferingHandler.__init__(self, 1000) self.config = config self.old_handlers = [] self.old_level = None # set my formatter log_format = datefmt = None if config.logging_format: log_format = config.logging_format else: log_format = '%(levelname)s:%(name)s:%(message)s' if config.logging_datefmt: datefmt = config.logging_datefmt formatter = logging.Formatter(log_format, datefmt) self.setFormatter(formatter) # figure the level we're logging at if level is not None: self.level = level elif config.logging_level: self.level = config.logging_level else: self.level = logging.NOTSET # construct my filter if config.logging_filter: self.addFilter(RecordFilter(config.logging_filter))
def __init__(self): # BufferingHandler takes a "capacity" argument # so as to know when to flush. As we're overriding # shouldFlush anyway, we can set a capacity of zero. # You can call flush() manually to clear out the # buffer. BufferingHandler.__init__(self, 0)
def __init__(self, config, level=None): BufferingHandler.__init__(self, 1000) self.config = config self.old_handlers = [] self.old_level = None # set my formatter fmt = datefmt = None if config.logging_format: fmt = config.logging_format else: fmt = '%(levelname)s:%(name)s:%(message)s' if config.logging_datefmt: datefmt = config.logging_datefmt fmt = logging.Formatter(fmt, datefmt) self.setFormatter(fmt) # figure the level we're logging at if level is not None: self.level = level elif config.logging_level: self.level = config.logging_level else: self.level = logging.NOTSET # construct my filter if config.logging_filter: self.addFilter(RecordFilter(config.logging_filter))
def __init__(self): # BufferingHandler takes a "capacity" argument # so as to know when to flush. As we're overriding # shouldFlush anyway, we can set a capacity of zero. # You can call flush() manually to clear out the # buffer. BufferingHandler.__init__(self, 0)
def __init__(self, config, level=None): BufferingHandler.__init__(self, 1000) self.config = config self.old_handlers = [] # set my formatter fmt = datefmt = None if config.logging_format: fmt = config.logging_format else: fmt = "%(levelname)s:%(name)s:%(message)s" if config.logging_datefmt: datefmt = config.logging_datefmt fmt = logging.Formatter(fmt, datefmt) self.setFormatter(fmt) # figure the level we're logging at if level is not None: self.level = level elif config.logging_level: self.level = getattr(logging, config.logging_level.upper(), None) if self.level is None: raise ConfigError('Invalid log level: "%s"' % config.logging_level) else: self.level = logging.NOTSET # construct my filter if config.logging_filter: self.addFilter(RecordFilter(config.logging_filter))
def __init__(self, config, level=None): BufferingHandler.__init__(self, 1000) self.config = config self.old_handlers = [] # set my formatter fmt = datefmt = None if config.logging_format: fmt = config.logging_format else: fmt = '%(levelname)s:%(name)s:%(message)s' if config.logging_datefmt: datefmt = config.logging_datefmt fmt = logging.Formatter(fmt, datefmt) self.setFormatter(fmt) # figure the level we're logging at if level is not None: self.level = level elif config.logging_level: self.level = getattr(logging, config.logging_level.upper(), None) if self.level is None: raise ConfigError('Invalid log level: "%s"' % config.logging_level) else: self.level = logging.NOTSET # construct my filter if config.logging_filter: self.addFilter(RecordFilter(config.logging_filter))
def __init__(self, indexed_keys={'level', 'short_message'}, debugging_fields=True, extra_fields=True, localname=None, measurement=None, level_names=False, capacity=64, flush_interval=5, backpop=True, **client_kwargs): self.debugging_fields = debugging_fields self.extra_fields = extra_fields self.localname = localname self.measurement = measurement self.level_names = level_names self.indexed_keys = indexed_keys self.client = InfluxDBClient(**client_kwargs) self.flush_interval = flush_interval self._thread = None if flush_interval is None else threading.Thread( target=self._flush_thread, name="BufferingInfluxHandler", daemon=True) InfluxHandler.__init__(self, indexed_keys=None, debugging_fields=debugging_fields, extra_fields=extra_fields, localname=localname, measurement=measurement, level_names=level_names, backpop=backpop, **client_kwargs) BufferingHandler.__init__(self, capacity) self._thread.start()
def __init__(self, target, thresholdLevel, retainLevel): BufferingHandler.__init__(self, capacity=0) self.target = target self.thresholdLevel = thresholdLevel if retainLevel is None: retainLevel = thresholdLevel self.setLevel(retainLevel)
def __init__(self, testcase): """Create a logging handler for the given test case. Args: testcase (unittest.TestCase): Owner of this logging handler. """ BufferingHandler.__init__(self, capacity=0) self.setLevel(logging.DEBUG) self.testcase = testcase
def __init__(self, user, password, email_to, email_subject, email_from=None, capacity=10000, host='smtp.gmail.com', port=465): BufferingHandler.__init__(self, capacity) self.host = host self.port = port self.user = user self.password = password self.email_from = user if email_from is None else email_from self.email_to = email_to self.email_subject = email_subject
def __init__(self, level, capacity, host, port, fromaddr, toaddrs, user=None, passwd=None, subject='logs', encoding='utf-8'): BufferingHandler.__init__(self, capacity) self.setLevel(level) self.host = host self.port = port self.fromaddr = fromaddr self.toaddrs = toaddrs if isinstance(toaddrs, (list, tuple)) else [toaddrs] self.user = user self.passwd = passwd self.subject = Header(subject) self.encoding = encoding
def __init__(self, capacity, fd_target): """ :param int capacity: Amount of records to store in memory https://github.com/python/cpython/blob/3.3/Lib/logging/handlers.py#L1161-L1176 :param object fd_target: File descriptor to write output to (e.g. `sys.stdout`) """ # Call our BufferingHandler init if issubclass(BufferingTargetHandler, object): super(BufferingTargetHandler, self).__init__(capacity) else: BufferingHandler.__init__(self, capacity) # Save target for later self._fd_target = fd_target
def __init__(self, capacity, fd_target): """ :param int capacity: Amount of records to store in memory https://github.com/python/cpython/blob/3.3/Lib/logging/handlers.py#L1161-L1176 :param object fd_target: File descriptor to write output to (e.g. `sys.stdout`) """ # Call our BufferingHandler init if issubclass(BufferingTargetHandler, object): super(BufferingTargetHandler, self).__init__(capacity) else: BufferingHandler.__init__(self, capacity) # Save target for later self._fd_target = fd_target
def __init__(self, level, capacity, host, port, fromaddr, toaddrs, user=None, passwd=None, subject='logs', encoding='utf-8'): BufferingHandler.__init__(self, capacity) self.setLevel(level) self.host = host self.port = port self.fromaddr = fromaddr self.toaddrs = toaddrs if isinstance(toaddrs, (list, tuple)) else [toaddrs] self.user = user self.passwd = passwd self.subject = Header(subject) self.encoding = encoding
def __init__(self, capacity, wait_on_flush=False, ch_conn='http://localhost:8123', ch_table=None, logging_build_in_columns_to_ch=None): """ Initialize the handler with the buffer size, the level at which flushing should occur and an optional target. Note that without a target being set either here or via setTarget(), a MemoryHandler is no use to anyone! """ BufferingHandler.__init__(self, capacity) self.wait_on_flush = wait_on_flush if not ch_table: raise ValueError('ch_table must be provided') self.ch_table = ch_table self.ch_conn = ch_conn self.build_in_keys_to_ch = logging_build_in_columns_to_ch or ['message', 'levelname', 'filename', 'module', 'lineno,', 'exc_info', 'created', 'msecs', 'relativeCreated', 'asctime'] self.build_in_log_keys = ['name', 'msg', 'args', 'levelname', 'levelno', 'pathname', 'filename', 'module', 'exc_info', 'exc_text', 'stack_info', 'lineno', 'funcName', 'created', 'msecs', 'relativeCreated', 'thread', 'threadName', 'processName', 'process']
def __init__(self, widget): BufferingHandler.__init__(self, 100) self.widget = widget
def __init__(self): BufferingHandler.__init__(self, maxsize)
def __init__(self, widget): BufferingHandler.__init__(self, 100) self.widget = widget
def __init__(self, bucket, prefix=''): BufferingHandler.__init__(self, 0) self.bucket = bucket self.prefix = prefix
def __init__(self): BufferingHandler.__init__(self, 0)
def __init__(self): # Capacity is zero, as we won't rely on # it when deciding when to flush data BufferingHandler.__init__(self, 0)
def __init__(self): BufferingHandler.__init__(self, maxsize)
def __init__(self): # Capacity is zero, as we won't rely on it when deciding when to flush # data BufferingHandler.__init__(self, 0)
def __init__(self, testcase): """Create a logging handler for the given test case.""" BufferingHandler.__init__(self, capacity=0) self.setLevel(logging.DEBUG) self.testcase = testcase
def __init__(self, capacity, queue): """ Initialize the handler with buffer size and queue """ BufferingHandler.__init__(self, capacity) self.queue = queue
def __init__(self, master_logger: Optional[logging.Logger] = None): BufferingHandler.__init__(self, capacity=1000000) self._master_logger = master_logger
def __init__(self, capacity): # BufferingHandler is old styled class, so we can't use super here. BufferingHandler.__init__(self, capacity) self._buffer = [] self._capacity = capacity self._position = 0
def __init__(self, capacity, logformat, logdatefmt, filters): BufferingHandler.__init__(self, capacity) fmt = logging.Formatter(logformat, logdatefmt) self.setFormatter(fmt) self.filterset = FilterSet(filters)
def __init__(self, capacity=1000000, flushLevel=logging.ERROR, target=None): BufferingHandler.__init__(self, capacity) self.target = target logger = logging.getLogger('AuditTrail') logger.info('AuditTrail.TransactionEndHandler> Registering with TM') transaction.manager.registerGlobalSynch(self)
def __init__(self, bucket, prefix=''): BufferingHandler.__init__(self, 0) self.bucket = bucket self.prefix = prefix
def __init__(self): BufferingHandler.__init__(self, 0)
def __init__(self): BufferingHandler.__init__(self, sys.maxint)
def __init__(self, capacity, logformat, logdatefmt, filters): BufferingHandler.__init__(self, capacity) fmt = logging.Formatter(logformat, logdatefmt) self.setFormatter(fmt) self.filterset = FilterSet(filters)
def __init__(self, capacity): # BufferingHandler is old styled class, so we can't use super here. BufferingHandler.__init__(self, capacity) self._buffer = [] self._capacity = capacity self._position = 0
def __init__(self): BufferingHandler.__init__(self, sys.maxint)
def __init__(self, capacity, queue): """ Initialize the handler with buffer size and queue """ BufferingHandler.__init__(self, capacity) self.queue = queue
def __init__(self, capacity = None): _BufferingHandler.__init__(self, capacity = capacity)
def __init__(self, capacity=None): _BufferingHandler.__init__(self, capacity=capacity)
def __init__(self, messages): BufferingHandler.__init__(self, 0) self.messages = messages