From 83f710da8f87ddd654d99eebc46c94c60fdcbe73 Mon Sep 17 00:00:00 2001 From: Josef Friedrich Date: Mon, 2 Sep 2024 12:03:31 +0200 Subject: [PATCH] Add docstrings --- check_systemd.py | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/check_systemd.py b/check_systemd.py index aa8bed4..2c95abf 100755 --- a/check_systemd.py +++ b/check_systemd.py @@ -333,15 +333,39 @@ def __log(self, level: int, color: str, msg: str, *args: object) -> None: self.__logger.log(level, msg, *a) def info(self, msg: str, *args: object) -> None: - """Log on debug level 1: ``-d``""" + """Log on debug level ``1``: ``-d``. + + :param msg: A message format string. Note that this means that you can + use keywords in the format string, together with a single + dictionary argument. No ``%`` formatting operation is performed on + ``msg`` when no args are supplied. + :param args: The arguments which are merged into ``msg`` using the + string formatting operator. + """ self.__log(self.__INFO, self.__BLUE, msg, *args) def debug(self, msg: str, *args: object) -> None: - """Log on debug level 2: ``-dd``""" + """Log on debug level ``2``: ``-dd``. + + :param msg: A message format string. Note that this means that you can + use keywords in the format string, together with a single + dictionary argument. No ``%`` formatting operation is performed on + ``msg`` when no args are supplied. + :param args: The arguments which are merged into ``msg`` using the + string formatting operator. + """ self.__log(self.__DEBUG, self.__PURPLE, msg, *args) def verbose(self, msg: str, *args: object) -> None: - """Log on debug level 3: ``-ddd``""" + """Log on debug level ``3``: ``-ddd`` + + :param msg: A message format string. Note that this means that you can + use keywords in the format string, together with a single + dictionary argument. No ``%`` formatting operation is performed on + ``msg`` when no args are supplied. + :param args: The arguments which are merged into ``msg`` using the + string formatting operator. + """ self.__log(self.__VERBOSE, self.__CYAN, msg, *args) def show_levels(self) -> None: