-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
42 lines (30 loc) · 1.54 KB
/
__init__.py
File metadata and controls
42 lines (30 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""Maya PySide Template Window Package
Maya 用の PySide テンプレートウィンドウプロジェクトです。
WorkspaceControl を使用したドッキング可能かつ復元可能なウィンドウのテンプレートです。
"""
import logging
from ._metadata import __author__, __version__
from .app.main import restart, restore, start
def setup_logging(log_level: int = logging.INFO) -> logging.Logger:
"""パッケージ用のロギング設定を行う
Args:
log_level (int): ログレベル(logging.DEBUG, logging.INFO など)
Maya では通常 INFO レベルがデフォルトです
Returns:
logging.Logger: 設定されたパッケージロガー
Note:
Maya環境では基本的なログハンドラーが自動設定されるため、
NullHandlerの追加は不要です。一般的なPythonライブラリでは
logger.addHandler(logging.NullHandler()) が推奨されますが、
Maya専用ツールでは実質的に無意味です。
Examples:
>>> # 基本的な使用方法(INFO レベル)
>>> logger = setup_logging()
>>> # デバッグ情報も出力したい場合
>>> logger = setup_logging(logging.DEBUG)
"""
# パッケージロガーのレベルを設定
logger = logging.getLogger(__name__) # __init__.py では __name__ が直接パッケージ名
logger.setLevel(log_level)
return logger
__all__ = ['start', 'restart', 'restore', 'setup_logging', '__version__', '__author__']