From 56c4f2056e12ae1e8299ddc97ee22ec44ebeb91c Mon Sep 17 00:00:00 2001 From: Lasse Schuirmann Date: Wed, 15 Apr 2015 13:30:34 +0200 Subject: [PATCH] Bear: fail_msg -> err We shouldn't have a logging API different than the one from the LogPrinter. --- coalib/bears/Bear.py | 6 +++--- coalib/tests/bears/BearTest.py | 4 ++-- doc/Getting_Involved/Writing_Bears.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/coalib/bears/Bear.py b/coalib/bears/Bear.py index cbca3e6ccb..b78672167c 100644 --- a/coalib/bears/Bear.py +++ b/coalib/bears/Bear.py @@ -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 @@ -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): diff --git a/coalib/tests/bears/BearTest.py b/coalib/tests/bears/BearTest.py index d6867e77e4..78509d9871 100644 --- a/coalib/tests/bears/BearTest.py +++ b/coalib/tests/bears/BearTest.py @@ -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.")) diff --git a/doc/Getting_Involved/Writing_Bears.md b/doc/Getting_Involved/Writing_Bears.md index f5e0941ce2..77a13130a7 100644 --- a/doc/Getting_Involved/Writing_Bears.md +++ b/doc/Getting_Involved/Writing_Bears.md @@ -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