From 05e3d142cb76473a1c79cf42c3aad46366446eed Mon Sep 17 00:00:00 2001 From: KWON Date: Mon, 28 Jul 2025 13:40:22 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=20=EC=B6=9C=EB=A0=A5=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/common.py b/lib/common.py index 42dbb57..2ef9416 100644 --- a/lib/common.py +++ b/lib/common.py @@ -1,5 +1,6 @@ # common.py import os, yaml +import logging def load_config(): """ @@ -8,3 +9,13 @@ def load_config(): path = os.path.join(os.path.dirname(__file__), '..', 'conf', 'config.yaml') with open(path, encoding='utf-8') as f: return yaml.safe_load(f) + +def get_logger(name): + logger = logging.getLogger(name) + if not logger.handlers: + handler = logging.StreamHandler() + formatter = logging.Formatter('[%(asctime)s] %(levelname)s: %(message)s') + handler.setFormatter(formatter) + logger.addHandler(handler) + logger.setLevel(logging.INFO) + return logger