def config_logging(): lcd = LCDict(attach_handlers_to_root=True, root_level='DEBUG') lcd.add_formatter( 'user_ip_level_msg', format='User: %(user)-10s IP: %(ip)-15s %(levelname)-8s %(message)s' ) lcd.add_stdout_handler('console-out', level='DEBUG', formatter='user_ip_level_msg') lcd.add_class_filter( 'field-adding_filter', FilterThatAddsFields, # extra, static data datasource=get_data) lcd.attach_root_filters('field-adding_filter') lcd.config()
def config_logging(): lcd = LCDict(attach_handlers_to_root=True, root_level='DEBUG') lcd.add_stdout_handler('console-out', level='DEBUG', formatter='level_msg') lcd.add_class_filter( 'count_debug', CountAndSquelchOdd, # extra, static data filtername='count_debug', loglevel_to_count=logging.DEBUG) lcd.add_class_filter( 'count_info', CountAndSquelchOdd, # extra, static data filtername='count_info', loglevel_to_count=logging.INFO) lcd.attach_root_filters('count_debug', 'count_info') lcd.config()