Skip to content

Commit

Permalink
Bear: fail_msg -> err
Browse files Browse the repository at this point in the history
We shouldn't have a logging API different than the one from the
LogPrinter.
  • Loading branch information
sils committed Apr 15, 2015
1 parent 1d2bc2c commit 56c4f20
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions coalib/bears/Bear.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class Bear:
will probably want to look at the GlobalBear and LocalBear classes that
inherit from this class. In any case you'll want to overwrite at least the
run method. You can send debug/warning/error messages through the
debug(), warn(), fail_msg() functions. These will send the
debug(), warn(), err() functions. These will send the
appropriate messages so that they are outputted. Be aware that if you use
fail_msg(), you are expected to also terminate the bear run-through
err(), you are expected to also terminate the bear run-through
immediately.
If you need some setup or teardown for your bear, feel free to overwrite
Expand Down Expand Up @@ -60,7 +60,7 @@ def debug(self, *args, delimiter=' '):
def warn(self, *args, delimiter=' '):
self.__send_msg(LOG_LEVEL.WARNING, delimiter, *args)

def fail_msg(self, *args, delimiter=' '):
def err(self, *args, delimiter=' '):
self.__send_msg(LOG_LEVEL.ERROR, delimiter, *args)

def __send_msg(self, log_level, delimiter, *args):
Expand Down
4 changes: 2 additions & 2 deletions coalib/tests/bears/BearTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def set_up(self):
self.debug("set", "up", delimiter="=")

def tear_down(self):
self.fail_msg("teardown")
self.fail_msg()
self.err("teardown")
self.err()

def run(self):
self.warn(_("A string to test translations."))
Expand Down
2 changes: 1 addition & 1 deletion doc/Getting_Involved/Writing_Bears.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ find it. We can do that with the `-d` (`--bear-dirs`) argument:

You should now see the debug message for our sample file.

The Bear class also supports `warn` and `fail_msg`.
The Bear class also supports `warn` and `err`.

## Communicating with the User

Expand Down

0 comments on commit 56c4f20

Please sign in to comment.