博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
宏定义 注意
阅读量:7084 次
发布时间:2019-06-28

本文共 1005 字,大约阅读时间需要 3 分钟。

#define _ALERT         0

#define _CRIT          1
#define _ERR           2
#define _WARNING       3
#define _NOTICE        4
#define _INFO          5
#define _DEBUG         6

#define DP_ALERT_TEXT       "ALERT:"

#define DP_CRIT_TEXT        "CRITICAL:"
#define DP_ERR_TEXT         "ERROR:"
#define DP_WARNING_TEXT     "WARNING:"
#define DP_NOTICE_TEXT      "NOTICE:"
#define DP_INFO_TEXT        "INFO:"
#define DP_DEBUG_TEXT       "DEBUG:"

static int debug_level;

#define DEBUG(lev, fmt, args...) \

    do { \
        if (debug_level > (lev)){ \
            fprintf(stderr, "%d [%d] " DP##lev##_TEXT fmt, time(), getpid(), __FUNCTION__, ## args); \
        } \
    }while(0)

#define LM_ALERT(fmt, args...)      DEBUG(_ALERT, fmt, ##args)

#define LM_CRIT(fmt, args...)       DEBUG(_CRIT, fmt, ##args)
#define LM_ERR(fmt, args...)        DEBUG(_ERR, fmt, ##args)
#define LM_WARN(fmt, args...)       DEBUG(_WARNING, fmt, ##args)
#define LM_NOTICE(fmt, args...)     DEBUG(_NOTICE, fmt, ##args)
#define LM_INFO(fmt, args...)       DEBUG(_INFO, fmt, ##args)
#define LM_DBG(fmt, args...)        DEBUG(_DEBUG, fmt, ##args)

 

转载于:https://www.cnblogs.com/moonflow/archive/2012/04/21/2462228.html

你可能感兴趣的文章
keepalived 实用简介
查看>>
svn http运行
查看>>
如何将Windows XP SP3改成SP2
查看>>
我的友情链接
查看>>
Spring 3.0
查看>>
curl 模拟qq登录
查看>>
从概念理解Lucene的Index(索引)文档模型
查看>>
实战MYSQL 8.0.12 主主复制配置过程
查看>>
IBM ServerGuide 9.0
查看>>
网维大师有盘网吧实施方案
查看>>
sql优化(三)
查看>>
转载:在 ANDROID DIALOG中使用AUTOCOMPLETETEXT
查看>>
spring boot 拦截器、过滤器、监听器、定时器使用
查看>>
java8新特性介绍(一)
查看>>
查看Linux服务器有没有无线网卡
查看>>
2015年10月23日作业
查看>>
Python---列表生成式
查看>>
学生信息管理系统改编
查看>>
量化标配:工作站个人版裸机配置
查看>>
『中级篇』手动建立一个base Image(14)
查看>>