diff --git a/.travis.yml b/.travis.yml index fe4f5c9..6d8d88e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,8 @@ deploy: - basescript/utils.py - examples/adder.py - examples/helloworld.py - name: basescript-0.3.3 - tag_name: 0.3.3 + name: basescript-0.3.4 + tag_name: 0.3.4 true: repo: deep-compute/basescript - provider: pypi diff --git a/basescript/basescript.py b/basescript/basescript.py index bc9962f..7680eb4 100644 --- a/basescript/basescript.py +++ b/basescript/basescript.py @@ -51,8 +51,7 @@ def __init__(self, args=None): quiet=self.args.quiet, level=self.args.log_level, fpath=self.args.log_file, - pre_hooks=self.define_log_pre_format_hooks(), - post_hooks=self.define_log_post_format_hooks(), + processors=self.define_log_processors(), metric_grouping_interval=self.args.metric_grouping_interval, minimal=self.args.minimal, ) @@ -92,25 +91,14 @@ def start(self): def name(self): return ".".join([x for x in (sys.argv[0].split(".")[0], self.args.name) if x]) - def define_log_pre_format_hooks(self): + def define_log_processors(self): """ - these hooks are called before the log has been rendered, but after - all necessary filtering by log_processors has taken place. - they must accept a single argument which is a dictionary. + These processors are called before a log is rendered but after + all necessary filtering by the default log processors has taken + place. They must have the function signature required by `structlog` """ return [] - def define_log_post_format_hooks(self): - """ - these hooks are called after the log has been rendered using - the log renderer defined in `define_log_renderer`. - they must accept a single argument which is the output of the - renderer - """ - # TODO remove this once structlog supports hooks or handlers - # these hooks accept a 'msg' and do not return anything - return [] - def define_subcommands(self, subcommands): """ Define subcommands (as defined at https://docs.python.org/2/library/argparse.html#sub-commands) diff --git a/setup.py b/setup.py index 45bc624..f44d807 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ def get_long_description(): long_description = get_long_description() -version = "0.3.3" +version = "0.3.4" setup( name="basescript", version=version,