feat : add setup_logging with hierarchical astrai logger

- setup_logging(): attach handler only to astrai logger, not root
- all astrai.* sub-module loggers inherit automatically
- controlled by ASTR_LOG_LEVEL env var (default INFO)
- called in if __name__ == '__main__' of each CLI script
This commit is contained in:
2026-07-27 08:13:48 +08:00
parent 53c804e233
commit 07625057f2
6 changed files with 38 additions and 0 deletions
+2
View File
@@ -5,6 +5,7 @@ import click
import torch
from tqdm import tqdm
from astrai import setup_logging
from astrai.inference import InferenceEngine
from astrai.model import AutoModel
from astrai.tokenize import AutoTokenizer
@@ -162,4 +163,5 @@ def generate_command(**kwargs):
if __name__ == "__main__":
setup_logging()
generate_command()