SemiDrive SSDK Appication Program Interface PTG3.0
asw_log.h
Go to the documentation of this file.
1
9#ifndef ASW_LOG_H__
10#define ASW_LOG_H__
11#include <debug.h>
12
13#define ASW_LOG_ENABLE 1
14
15#define ASW_LOG_LEVEL_EMERG SSDK_EMERG /*System is unusable*/
16#define ASW_LOG_LEVEL_ALERT SSDK_ALERT /*Action must be taken immediately*/
17#define ASW_LOG_LEVEL_CRIT SSDK_CRIT /*Critical conditions*/
18#define ASW_LOG_LEVEL_ERR SSDK_ERR /*Error conditions*/
19#define ASW_LOG_LEVEL_WARN SSDK_WARNING /*Warning conditions*/
20#define ASW_LOG_LEVEL_NOTICE \
21 SSDK_NOTICE /*Normal, but significant, \
22 conditions*/
23#define ASW_LOG_LEVEL_INFO SSDK_INFO /*Informational message*/
24#define ASW_LOG_LEVEL_DEBUG SSDK_DEBUG /*Debug-level message*/
25
26/*log level default*/
27#define ASW_LOG_LEVEL ASW_LOG_LEVEL_ERR
29#define ASW_LOG_EMERG(string, args...) \
30 if (ASW_LOG_ENABLE && (ASW_LOG_LEVEL >= ASW_LOG_LEVEL_EMERG)) { \
31 ssdk_printf(ASW_LOG_LEVEL_EMERG, "[ASW]EMERG|%s| " string "\r\n", \
32 __func__, ##args); \
33 }
35#define ASW_LOG_ALERT(string, args...) \
36 if (ASW_LOG_ENABLE && (ASW_LOG_LEVEL >= ASW_LOG_LEVEL_ALERT)) { \
37 ssdk_printf(ASW_LOG_LEVEL_ALERT, "[ASW]ALERT|%s| " string "\r\n", \
38 __func__, ##args); \
39 }
41#define ASW_LOG_CRIT(string, args...) \
42 if (ASW_LOG_ENABLE && (ASW_LOG_LEVEL >= ASW_LOG_LEVEL_CRIT)) { \
43 ssdk_printf(ASW_LOG_LEVEL_CRIT, "[ASW]CRIT|%s| " string "\r\n", \
44 __func__, ##args); \
45 }
47#define ASW_LOG_ERR(string, args...) \
48 if (ASW_LOG_ENABLE && (ASW_LOG_LEVEL >= ASW_LOG_LEVEL_ERR)) { \
49 ssdk_printf(ASW_LOG_LEVEL_ERR, "[ASW]ERR|%s| " string "\r\n", \
50 __func__, ##args); \
51 }
53#define ASW_LOG_WARN(string, args...) \
54 if (ASW_LOG_ENABLE && (ASW_LOG_LEVEL >= ASW_LOG_LEVEL_WARN)) { \
55 ssdk_printf(ASW_LOG_LEVEL_WARN, "[ASW]WARN|%s| " string "\r\n", \
56 __func__, ##args); \
57 }
59#define ASW_LOG_NOTICE(string, args...) \
60 if (ASW_LOG_ENABLE && (ASW_LOG_LEVEL >= ASW_LOG_LEVEL_NOTICE)) { \
61 ssdk_printf(ASW_LOG_LEVEL_NOTICE, "[ASW]NOTICE|%s| " string "\r\n", \
62 __func__, ##args); \
63 }
65#define ASW_LOG_INFO(string, args...) \
66 if (ASW_LOG_ENABLE && (ASW_LOG_LEVEL >= ASW_LOG_LEVEL_INFO)) { \
67 ssdk_printf(ASW_LOG_LEVEL_INFO, "[ASW]INFO|%s| " string "\r\n", \
68 __func__, ##args); \
69 }
71#define ASW_LOG_DEBUG(string, args...) \
72 if (ASW_LOG_ENABLE && (ASW_LOG_LEVEL >= ASW_LOG_LEVEL_DEBUG)) { \
73 ssdk_printf(ASW_LOG_LEVEL_DEBUG, "[ASW]DEBUG|%s| " string "\r\n", \
74 __func__, ##args); \
75 }
77#define ASW_LOG_FUNC() \
78 if (ASW_LOG_ENABLE && (ASW_LOG_LEVEL >= ASW_LOG_LEVEL_INFO)) { \
79 ssdk_printf(ASW_LOG_LEVEL_INFO, "[ASW]FUNC|%s\r\n", __func__); \
80 }
81
82#endif //_ASW_DRV_LOG_H__