1 /* 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 * Description: common logging producer interface - need to change name of log.h in all the protocol core files 15 * Author: 16 * Create: 17 */ 18 19 #ifndef LOG_COMMON_H 20 #define LOG_COMMON_H 21 22 /** 23 * @addtogroup connectivity_libs_log 24 * @{ 25 */ 26 #include "panic.h" 27 #include "log_types.h" 28 #include "log_buffer_common.h" 29 #include "log_oam_logger.h" 30 #include "log_oam_status.h" 31 #include "log_oam_pcm.h" 32 #include "log_oam_ota.h" 33 34 uint16_t get_log_sn_number(void); 35 36 void log_init(void); 37 38 void log_init_after_rtos(void); 39 40 /** 41 * @brief Log the given log message 42 * @param buffer 43 * @param length 44 */ 45 void log_event(const uint8_t *buffer, uint16_t length); 46 47 /** 48 * @brief Set local log level from system log level 49 */ 50 void log_set_local_log_level(log_level_e log_level); 51 52 /** 53 * @brief Get current log level 54 * @return current log level 55 */ 56 log_level_e log_get_local_log_level(void); 57 58 #if SYS_DEBUG_MODE_ENABLE == YES 59 /** 60 * @brief Register oam command callback 61 */ 62 void log_register_oam_msg_callback(void); 63 #endif /* end of SYS_DEBUG_MODE_ENABLE == YES */ 64 65 /** 66 * @brief massdata init 67 */ 68 void massdata_init(void); 69 70 /** 71 * @brief Get missed messages count 72 * @return missed messages count 73 */ 74 uint32_t log_get_missed_messages_count(void); 75 76 /** 77 * @brief Get all messages count 78 * @return all messages count 79 */ 80 uint32_t log_get_all_messages_count(void); 81 82 /** 83 * @} 84 */ 85 #endif 86