2 * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
4 * Contact: Suresh Kumar N (suresh.n@samsung.com)
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 #ifndef __ZIGBEE_LOG_H__
20 #define __ZIGBEE_LOG_H__
24 #define TIZEN_DEBUG_ENABLE
26 #ifndef ZIGBEE_LOG_TAG
27 #define ZIGBEE_LOG_TAG "UNKNOWN"
30 enum zigbee_log_type {
31 ZIGBEE_LOG_TYPE_MAIN = 0,
32 ZIGBEE_LOG_TYPE_RADIO,
33 ZIGBEE_LOG_TYPE_SYSTEM,
34 ZIGBEE_LOG_TYPE_TIME_CHECK
37 enum zigbee_log_priority {
38 ZIGBEE_LOG_UNKNOWN = 0,
49 void zigbee_log(enum zigbee_log_type type, enum zigbee_log_priority priority, const char *tag, const char *fmt, ...);
51 /* Logs would be available in system logs */
52 #define Z_LOGI(fmt,args...) do { zigbee_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_INFO, ZIGBEE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
53 #define Z_LOGM(fmt,args...) do { zigbee_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_INFO, ZIGBEE_LOG_TAG, fmt "\n", ##args); } while (0)
54 #define Z_LOGD(fmt,args...) do { zigbee_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_DEBUG, ZIGBEE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
55 #define Z_LOGW(fmt,args...) do { zigbee_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_WARN, ZIGBEE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
56 #define Z_LOGE(fmt,args...) do { zigbee_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_ERROR, ZIGBEE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
57 #define Z_LOGF(fmt,args...) do { zigbee_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_FATAL, ZIGBEE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
59 #endif /* __ZIGBEE_LOG_H__ */