Skip to content

Commit

Permalink
Merge pull request #56 from amashita/55
Browse files Browse the repository at this point in the history
  • Loading branch information
amashita committed Dec 13, 2020
2 parents 2629a8a + 6d24449 commit 44c759a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 34 deletions.
2 changes: 1 addition & 1 deletion gmocoin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!python3
__version__ = '0.0.4'
__version__ = '0.0.5'
33 changes: 0 additions & 33 deletions gmocoin/common/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,6 @@
from pathlib import Path


# グローバル変数 ログ保存フォルダパス
g_log_dir = Path('./')


def set_log_dir(dir: str) -> None:
"""
ログの出力ディレクトリを指定します。
Args:
dir (str) :
ログの出力ディレクトリ
"""
global g_log_dir
g_log_dir = Path(dir)


def get_log_path() -> str:
"""
ログの出力ファイルを取得します。
Returns:
output file path(str):
"""
return str(g_log_dir / 'GmoCoin.log')


def get_logger() -> logging.Logger:
"""
logging.Loggerを作成します。
Expand All @@ -40,13 +14,6 @@ def get_logger() -> logging.Logger:
logging.Loggerのインスタンス
"""

# basicConfigのformat引数でログのフォーマットを指定する
log_format = '[%(asctime)s] [%(thread)d] %(levelname)s\t%(filename)s' \
' - %(funcName)s:%(lineno)s -> %(message)s'
logging.basicConfig(filename=get_log_path(),
format=log_format,
level=logging.DEBUG,
filemode='w')
logger = logging.getLogger(__name__)
return logger

Expand Down

0 comments on commit 44c759a

Please sign in to comment.