@@ -51,8 +51,7 @@ def __init__(self, args=None):
5151 quiet = self .args .quiet ,
5252 level = self .args .log_level ,
5353 fpath = self .args .log_file ,
54- pre_hooks = self .define_log_pre_format_hooks (),
55- post_hooks = self .define_log_post_format_hooks (),
54+ processors = self .define_log_processors (),
5655 metric_grouping_interval = self .args .metric_grouping_interval ,
5756 minimal = self .args .minimal ,
5857 )
@@ -92,25 +91,14 @@ def start(self):
9291 def name (self ):
9392 return "." .join ([x for x in (sys .argv [0 ].split ("." )[0 ], self .args .name ) if x ])
9493
95- def define_log_pre_format_hooks (self ):
94+ def define_log_processors (self ):
9695 """
97- these hooks are called before the log has been rendered, but after
98- all necessary filtering by log_processors has taken place.
99- they must accept a single argument which is a dictionary.
96+ These processors are called before a log is rendered but after
97+ all necessary filtering by the default log processors has taken
98+ place. They must have the function signature required by `structlog`
10099 """
101100 return []
102101
103- def define_log_post_format_hooks (self ):
104- """
105- these hooks are called after the log has been rendered using
106- the log renderer defined in `define_log_renderer`.
107- they must accept a single argument which is the output of the
108- renderer
109- """
110- # TODO remove this once structlog supports hooks or handlers
111- # these hooks accept a 'msg' and do not return anything
112- return []
113-
114102 def define_subcommands (self , subcommands ):
115103 """
116104 Define subcommands (as defined at https://docs.python.org/2/library/argparse.html#sub-commands)
0 commit comments