From dc95b480ca0c75e0c2241e8b0677c26a0eec06f7 Mon Sep 17 00:00:00 2001 From: caohongtao Date: Tue, 30 Apr 2024 14:28:23 +0800 Subject: [PATCH] Use oebuild.m_log to save log information * use logger to save; Signed-off-by: caohongtao --- src/oebuild/parse_template.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/oebuild/parse_template.py b/src/oebuild/parse_template.py index 1ff57c8..caec95a 100644 --- a/src/oebuild/parse_template.py +++ b/src/oebuild/parse_template.py @@ -9,7 +9,6 @@ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details. ''' -import logging import sys from dataclasses import dataclass from typing import Optional @@ -17,7 +16,7 @@ import pathlib import os from ruamel.yaml.scalarstring import LiteralScalarString - +from oebuild.m_log import logger import oebuild.util as oebuild_util import oebuild.const as oebuild_const from oebuild.struct import RepoParam @@ -127,7 +126,7 @@ class ParseTemplate: if self.platform is None: self.platform = os.path.splitext(config_name)[0].strip("\n") else: - logging.error("Only one platform is allowed") + logger.error("Only one platform is allowed") sys.exit(-1) self.platform_template = PlatformTemplate( machine=data['machine'], @@ -141,7 +140,7 @@ class ParseTemplate: raise PlatformNotAdd('please add platform template first') if self.platform is None: - logging.error("Platform not specified") + logger.error("Platform not specified") sys.exit(-1) support_arch = [] @@ -304,7 +303,7 @@ def parse_repos_layers_local_obj(common_yaml_path): parse from yaml to repos, layers and local ''' if not os.path.exists(common_yaml_path): - logging.error('can not find .oebuild/common.yaml in yocto-meta-openeuler') + logger.error('Can not find .oebuild/common.yaml in yocto-meta-openeuler') sys.exit(-1) data = oebuild_util.read_yaml(common_yaml_path) -- Gitee