diff --git a/heracles/__init__.py b/heracles/__init__.py index 08a3b7d..95eb4f5 100644 --- a/heracles/__init__.py +++ b/heracles/__init__.py @@ -17,7 +17,21 @@ # You should have received a copy of the GNU Lesser General Public # License along with Heracles. If not, see . +import logging + try: from ._version import __version__, __version_tuple__ # noqa: F401 except ModuleNotFoundError: pass + +_logger = logging.getLogger(__name__) + +_formatter = logging.Formatter( + "%(levelname)s [%(asctime)s] heracles: %(message)s", + datefmt="%Y-%m-%d %H:%M:%S", +) +_console_handler = logging.StreamHandler() +_console_handler.setFormatter(_formatter) +_logger.addHandler(_console_handler) +_logger.setLevel("INFO") +_logger.propagate = False