|
12 | 12 | import logging |
13 | 13 | import os |
14 | 14 | import traceback |
15 | | -import warnings |
16 | 15 | from concurrent.futures import ThreadPoolExecutor |
17 | 16 | from functools import partial |
18 | | -from logging import Logger |
19 | 17 | from logging.config import dictConfig |
20 | 18 | from typing import Tuple |
21 | 19 |
|
22 | 20 | from .consts import BACKUP_COUNT, MAX_BYTES |
23 | 21 | from .log import aelog_config, aelog_default_config |
24 | 22 |
|
25 | | -__all__ = ("init_app", "get_logger", "debug", "info", "warning", "error", "critical", "exception", |
26 | | - "async_debug", "async_info", "async_warning", "async_error", "async_exception", "async_critical") |
| 23 | +__all__ = ("init_app", "debug", "info", "warning", "error", "critical", "exception", "async_debug", |
| 24 | + "async_info", "async_warning", "async_error", "async_exception", "async_critical") |
27 | 25 |
|
28 | 26 | _pool = ThreadPoolExecutor() |
29 | 27 |
|
@@ -60,23 +58,6 @@ def init_app(app=None, *, aelog_access_file: str = None, aelog_error_file: str = |
60 | 58 | aelog_conf = aelog_config(aelog_access_file, error_file=aelog_error_file, console=aelog_console, |
61 | 59 | loglevel=loglevel, max_bytes=aelog_max_bytes, backup_count=aelog_backup_count) |
62 | 60 | dictConfig(aelog_conf) |
63 | | - setattr(init_app, "init_flag", True) |
64 | | - |
65 | | - |
66 | | -def get_logger() -> Logger: |
67 | | - """ |
68 | | - get logger object, If the aelog has no initialize, call init_aelog() and output to the terminal. |
69 | | - Args: |
70 | | -
|
71 | | - Returns: |
72 | | -
|
73 | | - """ |
74 | | - warnings.warn("`get_logger` option is deprecated in version 1.0.5. Use `aelog` instead.", |
75 | | - DeprecationWarning) |
76 | | - if not getattr(init_app, "init_flag", None): |
77 | | - init_app() |
78 | | - caller_module = inspect.getmodule(inspect.currentframe().f_back) # type: ignore |
79 | | - return logging.getLogger(caller_module.__name__ if caller_module else "") |
80 | 61 |
|
81 | 62 |
|
82 | 63 | def find_caller(caller_frame, stack_info=False) -> Tuple: |
|
0 commit comments