style: フォーマット適用とコメント追加

This commit is contained in:
shimoda.m@nds-tyo.co.jp 2023-04-12 15:19:18 +09:00
parent 26c4170643
commit 91e92d880b
3 changed files with 12 additions and 4 deletions

View File

@ -53,4 +53,4 @@ def logging_sql(logger, sql):
logger (logging.Logger): ロガー
sql (str): SQL文
"""
logger.debug(f'\n{"-"*15}\n{textwrap.dedent(sql)[1:-1]}\n{"-"*15}')
logger.debug(f'\n{"-"*15}\n{textwrap.dedent(sql)[1:-1]}\n{"-"*15}')

View File

@ -5,6 +5,6 @@ class BatchConfig:
@classmethod
def get_instance(cls):
if cls.__instance == None:
if cls.__instance is None:
cls.__instance = cls()
return cls.__instance

View File

@ -6,8 +6,16 @@ from src.system_var.environment import LOG_LEVEL
for name in ["boto3", "botocore", "s3transfer", "urllib3"]:
logging.getLogger(name).setLevel(logging.WARNING)
# 共通ロガー
def get_logger(log_name):
def get_logger(log_name: str) -> logging.Logger:
"""一意のログ出力モジュールを取得します。
Args:
log_name (str): ロガー名
Returns:
_type_: _description_
"""
logger = logging.getLogger(log_name)
level = logging.getLevelName(LOG_LEVEL)
if not isinstance(level, int):