From 6f08d5f0bb338fd3d2fdfa583a866cae36af9bef Mon Sep 17 00:00:00 2001 From: "liyihan2@huawei.com" Date: Mon, 29 Mar 2021 19:34:19 +0800 Subject: [PATCH] common formats log optimize --- .../format_transfer_fractal_nz.cc | 28 ++++++++----------- .../format_transfer_fractal_zz.cc | 8 +++--- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc index eda3a5a9..d647b7f5 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc @@ -334,27 +334,23 @@ Status FormatTransferFractalNz::TransShape(Format src_format, const ShapeVector Format dst_format, ShapeVector &dst_shape) { if (!IsDataTypeSupport(data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, - "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); REPORT_INNER_ERROR("E19999", - "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + "Check datatype failed, trans format from %s to %s, src shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(src_format).c_str(),TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShape(src_format, src_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, - "[Check][Shape]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + "[Check][Shape]Failed, trans format from %s to %s, src shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } ShapeVector hw_shape; diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc index a19f3fcf..bca25e78 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc @@ -118,14 +118,14 @@ Status CheckShapeRelation(const TransArgs &args, ShapeVector &hw_shape) { ShapeVector expect_src_shape; auto ret = TransShapeToFracZz(args.dst_shape, args.src_data_type, expect_src_shape, hw_shape); if (ret != SUCCESS) { - GELOGE(ret, "[Transfer][ShapeToFracZz] Failed from %s to %s, shape %s to %s, data type %s, error_code %u", + GELOGE(ret, "[Transfer][ShapeToFracZz] Failed from %s to %s, shape %s to %s, data type %s", TypeUtils::FormatToSerialString(args.dst_format).c_str(), TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); - REPORT_INNER_ERROR(ret, "Failed to transfer shape from %s to %s, shape %s to %s, data type %s, error_code %u", + ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR(ret, "Failed to transfer shape from %s to %s, shape %s to %s, data type %s", TypeUtils::FormatToSerialString(args.dst_format).c_str(), TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); + ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ret; } if (!IsTransShapeSrcCorrect(args, expect_src_shape)) {