배치 실계좌에서 종목조회로 변경
This commit is contained in:
18
backend/app/core/logging_config.py
Normal file
18
backend/app/core/logging_config.py
Normal file
@@ -0,0 +1,18 @@
|
||||
"""공통 로깅 설정 — KST(Asia/Seoul) 타임존 포매터 제공."""
|
||||
|
||||
import logging
|
||||
import datetime
|
||||
import pytz
|
||||
|
||||
KST = pytz.timezone("Asia/Seoul")
|
||||
|
||||
|
||||
class KSTFormatter(logging.Formatter):
|
||||
"""%(asctime)s 를 KST(UTC+9) 기준으로 출력하는 포매터."""
|
||||
|
||||
def formatTime(self, record: logging.LogRecord, datefmt: str | None = None) -> str:
|
||||
ct = datetime.datetime.fromtimestamp(record.created, tz=KST)
|
||||
if datefmt:
|
||||
return ct.strftime(datefmt)
|
||||
t = ct.strftime(self.default_time_format)
|
||||
return self.default_msec_format % (t, record.msecs)
|
||||
Reference in New Issue
Block a user