LCOV - code coverage report
Current view: top level - legacy/ascend910/framework/device/inc - log_control.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 6 6
Test Date: 2026-07-28 12:11:00 Functions: 100.0 % 2 2

            Line data    Source code
       1              : /**
       2              :  * Copyright (c) 2025 Huawei Technologies Co., Ltd.
       3              :  * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
       4              :  * CANN Open Software License Agreement Version 2.0 (the "License").
       5              :  * Please refer to the License for details. You may not use this file except in compliance with the License.
       6              :  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
       7              :  * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
       8              :  * See LICENSE in the root of the software repository for the full text of the License.
       9              :  */
      10              : 
      11              : #ifndef LOG_CONTROL_H
      12              : #define LOG_CONTROL_H
      13              : 
      14              : #include "log.h"
      15              : 
      16              : // 用于将特定场景下的ERROR日志,转换为RUN_WARNING日志
      17              : class LogControl {
      18              : public:
      19              :     // 构造时初始化initState,并将当前日志级别设置为targetState
      20            3 :     LogControl(bool initState, bool targetState) : initState_(initState) {
      21            3 :         SetErrToWarnSwitch(targetState);
      22            3 :     }
      23              : 
      24              :     // 析构时恢复为initState
      25            3 :     ~LogControl() {
      26            3 :         SetErrToWarnSwitch(initState_);
      27            3 :     }
      28              : private:
      29              :     bool initState_ = false;
      30              : };
      31              : 
      32              : #endif  // LOG_CONTROL_H
        

Generated by: LCOV version 2.0-1