Skip to content

Commit

Permalink
references #98, fixed the issue and tested the hello world example wo…
Browse files Browse the repository at this point in the history
…rks as expected
  • Loading branch information
prashanthellina committed Sep 18, 2019
1 parent 0ab34ac commit 1fda354
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 5 additions & 17 deletions basescript/basescript.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1fda354

Please sign in to comment.