Repository: PaddlePaddle/PaddleSpeech

Issue:
develop  版本 paddlespeech_server 启动后会打印 2 遍 log
```bash
paddlespeech_server start --config_file ./conf/application.yaml
```
log：
```text
[2022-06-23 06:18:31,311] [    INFO] - start to init the engine
[2022-06-23 06:18:31,311] [    INFO] - start to init the engine
[2022-06-23 06:18:31,312] [    INFO] - tts : python engine.
[2022-06-23 06:18:31,312] [    INFO] - tts : python engine.
from .pretrained_models import tts_dynamic_pretrained_models
[2022-06-23 06:18:36,330] [    INFO] - File /home/xxx/.paddlespeech/models/fastspeech2_csmsc-zh/1.0/fastspeech2_nosil_baker_ckpt_0.4.zip md5 checking...
[2022-06-23 06:18:36,330] [    INFO] - File /home/xxx/.paddlespeech/models/fastspeech2_csmsc-zh/1.0/fastspeech2_nosil_baker_ckpt_0.4.zip md5 checking...
[2022-06-23 06:18:37,699] [    INFO] - /home/xxx/.paddlespeech/models/fastspeech2_csmsc-zh/1.0/fastspeech2_nosil_baker_ckpt_0.4
[2022-06-23 06:18:37,699] [    INFO] - /home/xxx/.paddlespeech/models/fastspeech2_csmsc-zh/1.0/fastspeech2_nosil_baker_ckpt_0.4
[2022-06-23 06:18:37,699] [    INFO] - /home/xxx/.paddlespeech/models/fastspeech2_csmsc-zh/1.0/fastspeech2_nosil_baker_ckpt_0.4/default.yaml
[2022-06-23 06:18:37,699] [    INFO] - /home/xxx/.paddlespeech/models/fastspeech2_csmsc-zh/1.0/fastspeech2_nosil_baker_ckpt_0.4/default.yaml
[2022-06-23 06:18:37,700] [    INFO] - /home/xxx/.paddlespeech/models/fastspeech2_csmsc-zh/1.0/fastspeech2_nosil_baker_ckpt_0.4/snapshot_iter_76000.pdz
[2022-06-23 06:18:37,700] [    INFO] - /home/xxx/.paddlespeech/models/fastspeech2_csmsc-zh/1.0/fastspeech2_nosil_baker_ckpt_0.4/snapshot_iter_76000.pdz
[2022-06-23 06:18:37,700] [    INFO] - File /home/xxx/.paddlespeech/models/pwgan_csmsc-zh/1.0/pwg_baker_ckpt_0.4.zip md5 checking...
[2022-06-23 06:18:37,700] [    INFO] - File /home/xxx/.paddlespeech/models/pwgan_csmsc-zh/1.0/pwg_baker_ckpt_0.4.zip md5 checking...
[2022-06-23 06:18:37,744] [    INFO] - /home/xxx/.paddlespeech/models/pwgan_csmsc-zh/1.0/pwg_baker_ckpt_0.4
[2022-06-23 06:18:37,744] [    INFO] - /home/xxx/.paddlespeech/models/pwgan_csmsc-zh/1.0/pwg_baker_ckpt_0.4
[2022-06-23 06:18:37,744] [    INFO] - /home/xxx/.paddlespeech/models/pwgan_csmsc-zh/1.0/pwg_baker_ckpt_0.4/pwg_default.yaml
[2022-06-23 06:18:37,744] [    INFO] - /home/xxx/.paddlespeech/models/pwgan_csmsc-zh/1.0/pwg_baker_ckpt_0.4/pwg_default.yaml
[2022-06-23 06:18:37,744] [    INFO] - /home/xxx/.paddlespeech/models/pwgan_csmsc-zh/1.0/pwg_baker_ckpt_0.4/pwg_snapshot_iter_400000.pdz
[2022-06-23 06:18:37,744] [    INFO] - /home/xxx/.paddlespeech/models/pwgan_csmsc-zh/1.0/pwg_baker_ckpt_0.4/pwg_snapshot_iter_400000.pdz
vocab_size: 268
frontend done!
```
有问题的 commit 号：
```text
5e03d75
```

没问题的 commit 号：
```text
803800
```
引起问题的 commit
<img width="522" alt="image" src="https://user-images.githubusercontent.com/24568452/175233071-0cf2e8fa-78e0-4497-afa9-584b4b61c3bd.png">




Discussion:

Resolving patch:
diff --git a/paddlespeech/server/engine/engine_factory.py b/paddlespeech/server/engine/engine_factory.py
--- a/paddlespeech/server/engine/engine_factory.py
+++ b/paddlespeech/server/engine/engine_factory.py
@@ -13,7 +13,7 @@
 # limitations under the License.
 from typing import Text
 
-from ..utils.log import logger
+from paddlespeech.cli.log import logger
 
 __all__ = ['EngineFactory']
 
diff --git a/paddlespeech/server/utils/log.py b/paddlespeech/server/utils/log.py
deleted file mode 100644
--- a/paddlespeech/server/utils/log.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-import functools
-import logging
-
-__all__ = [
-    'logger',
-]
-
-
-class Logger(object):
-    def __init__(self, name: str=None):
-        name = 'PaddleSpeech' if not name else name
-        self.logger = logging.getLogger(name)
-
-        log_config = {
-            'DEBUG': 10,
-            'INFO': 20,
-            'TRAIN': 21,
-            'EVAL': 22,
-            'WARNING': 30,
-            'ERROR': 40,
-            'CRITICAL': 50,
-            'EXCEPTION': 100,
-        }
-        for key, level in log_config.items():
-            logging.addLevelName(level, key)
-            if key == 'EXCEPTION':
-                self.__dict__[key.lower()] = self.logger.exception
-            else:
-                self.__dict__[key.lower()] = functools.partial(self.__call__,
-                                                               level)
-
-        self.format = logging.Formatter(
-            fmt='[%(asctime)-15s] [%(levelname)8s] - %(message)s')
-
-        self.handler = logging.StreamHandler()
-        self.handler.setFormatter(self.format)
-
-        self.logger.addHandler(self.handler)
-        self.logger.setLevel(logging.DEBUG)
-        self.logger.propagate = False
-
-    def __call__(self, log_level: str, msg: str):
-        self.logger.log(log_level, msg)
-
-
-logger = Logger()
diff --git a/paddlespeech/server/utils/onnx_infer.py b/paddlespeech/server/utils/onnx_infer.py
--- a/paddlespeech/server/utils/onnx_infer.py
+++ b/paddlespeech/server/utils/onnx_infer.py
@@ -16,7 +16,7 @@
 
 import onnxruntime as ort
 
-from .log import logger
+from paddlespeech.cli.log import logger
 
 
 def get_sess(model_path: Optional[os.PathLike]=None, sess_conf: dict=None):


Test patch: