msgout.h
来自「linux下的飞鸽传书 日本人设计 使用非常方便」· C头文件 代码 · 共 40 行
H
40 行
#if !defined(MSGOUT_H)#define MSGOUT_H//#define DEBUG 1#if defined(DEBUG)#define dbg_out(fmt,arg...) do{ \ fprintf(stderr, "[file:%s function: %s line:%d ] " fmt,__FILE__,__FUNCTION__,__LINE__,##arg); \ syslog(LOG_INFO|LOG_USER, "[file:%s function: %s line:%d ] " fmt,__FILE__,__FUNCTION__,__LINE__,##arg); \ fflush(stderr); \ }while(0)#else#define dbg_out(fmt,arg...) do{ \ if (hostinfo_refer_debug_state()){ \ fprintf(stderr, "[file:%s function: %s line:%d ] " fmt,__FILE__,__FUNCTION__,__LINE__,##arg); \ syslog(LOG_INFO|LOG_USER, "[file:%s function: %s line:%d ] " fmt,__FILE__,__FUNCTION__,__LINE__,##arg); \ fflush(stderr); \ } \ }while(0) #endif#define war_out(fmt,arg...) do{ \ fprintf(stderr, "Warning : [file:%s line:%d ] " fmt,__FILE__,__LINE__,##arg); \ fflush(stderr); \ syslog(LOG_WARNING|LOG_USER, "[file:%s function: %s line:%d ] " fmt,__FILE__,__FUNCTION__,__LINE__,##arg); \ }while(0)#define err_out(fmt,arg...) do{ \ fprintf(stderr, "Error : [file:%s line:%d ] " fmt,__FILE__,__LINE__,##arg); \ fflush(stderr); \ syslog(LOG_ERR|LOG_USER, "[file:%s function: %s line:%d ] " fmt,__FILE__,__FUNCTION__,__LINE__,##arg); \ }while(0)#define _assert(cond) do{ \ if (!(cond)) { \ fprintf(stderr, "Assertion : [file:%s line:%d ]\n",__FILE__,__LINE__); \ fflush(stderr); \ abort(); \ } \ }while(0)#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?