Skip to content

Commit

Permalink
Bear: warn_msg -> warn
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 4a74d67 commit 1d2bc2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions coalib/bears/Bear.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ 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_msg(), fail_msg() functions. These will send the
debug(), warn(), fail_msg() 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
immediately.
Expand Down Expand Up @@ -57,7 +57,7 @@ def tear_down(self):
def debug(self, *args, delimiter=' '):
self.__send_msg(LOG_LEVEL.DEBUG, delimiter, *args)

def warn_msg(self, *args, delimiter=' '):
def warn(self, *args, delimiter=' '):
self.__send_msg(LOG_LEVEL.WARNING, delimiter, *args)

def fail_msg(self, *args, delimiter=' '):
Expand Down Expand Up @@ -99,7 +99,7 @@ def execute(self, *args, **kwargs):

return retval
except:
self.warn_msg(
self.warn(
_("Bear {} failed to run.").format(name))
self.debug(_("The bear {bear} raised an exception. If you are "
"the writer of this bear, please make sure "
Expand Down
2 changes: 1 addition & 1 deletion coalib/tests/bears/BearTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def tear_down(self):
self.fail_msg()

def run(self):
self.warn_msg(_("A string to test translations."))
self.warn(_("A string to test translations."))

@staticmethod
def get_dependencies():
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_msg` and `fail_msg`.
The Bear class also supports `warn` and `fail_msg`.

## Communicating with the User

Expand Down

0 comments on commit 1d2bc2c

Please sign in to comment.