Skip to content

Commit

Permalink
Remove common.log (API break)
Browse files Browse the repository at this point in the history
Small API break, replace:
 from byexample.common import log
 log(<msg>, <lvl>, <concerns>)
by
 from byexample.log import clog
 clog().<lvl-method>(<msg>)

clog() will search for the best logger based in which part of the
execution is and it will log through the concerns (event methods)
if they are available otherwise it will log to the terminal/console.
  • Loading branch information
eldipa committed Aug 29, 2019
1 parent 8d34657 commit f7bdda6
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions byexample/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ def build_where_msg(where, owner, msg=None, use_colors=False):

return ''.join(tmp)


def log(msg, lvl, concerns=None):
if isinstance(lvl, int):
if lvl >= 0:
print(msg)

else:
concerns.event('log', msg=msg, level=lvl)

def colored(s, color, use_colors):
if use_colors:
if color == 'none':
Expand Down

0 comments on commit f7bdda6

Please sign in to comment.