mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Add logging for registered hooks
This commit is contained in:
parent
8eb01129fe
commit
be726cc955
|
@ -13,8 +13,10 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with RcGcDw. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import logging
|
||||
import src.api.hooks
|
||||
|
||||
logger = logging.getLogger("src.api.hook")
|
||||
|
||||
def pre_hook(func):
|
||||
"""
|
||||
|
@ -22,6 +24,7 @@ def pre_hook(func):
|
|||
|
||||
:return: func
|
||||
"""
|
||||
logger.info("{hook_name} has been registered as a pre hook.".format(hook_name=func.__name__))
|
||||
src.api.hooks.pre_hooks.append(func)
|
||||
return func
|
||||
|
||||
|
@ -32,5 +35,6 @@ def post_hook(func):
|
|||
|
||||
:return: func
|
||||
"""
|
||||
logger.info("{hook_name} has been registered as a post hook.".format(hook_name=func.__name__))
|
||||
src.api.hooks.post_hooks.append(func)
|
||||
return func
|
||||
|
|
Loading…
Reference in a new issue