diff --git a/rwx/log/__init__.py b/rwx/log/__init__.py index b951ac9..a567492 100644 --- a/rwx/log/__init__.py +++ b/rwx/log/__init__.py @@ -1,6 +1,6 @@ import logging import sys -def get_logger(name: str) -> logging.Logger: +def get_file_logger(name: str) -> logging.Logger: formatter = logging.Formatter( "%(name)s: %(asctime)s | %(levelname)s | %(filename)s:%(lineno)s | %(process)d >>> %(message)s", ) @@ -14,3 +14,13 @@ def get_logger(name: str) -> logging.Logger: logger.setLevel(logging.INFO) # return logger +def get_stream_logger() -> logging.Logger: + out_handler = logging.StreamHandler(stream=sys.stdout) + out_handler.setLevel(logging.INFO) + # + logger = logging.getLogger() + logger.addHandler(out_handler) + logger.setLevel(logging.INFO) + # + return logger +stream = get_stream_logger()