4 Star 10 Fork 7

liudengfeng/xfrpc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
debug.h 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
// SPDX-License-Identifier: GPL-3.0-only
/*
* Copyright (c) 2023 Dengfeng Liu <liudf0716@gmail.com>
*/
#ifndef XFRPC_DEBUG_H
#define XFRPC_DEBUG_H
#include <string.h>
#include <syslog.h>
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
typedef struct _debug_conf {
int debuglevel; /**< @brief Debug information verbosity */
int log_stderr; /**< @brief Output log to stdout */
int log_syslog; /**< @brief Output log to syslog */
int syslog_facility; /**< @brief facility to use when using syslog for logging */
} debugconf_t;
extern debugconf_t debugconf;
/** Used to output messages.
* The messages will include the filename and line number, and will be sent to syslog if so configured in the config file
* @param level Debug level
* @param format... sprintf like format string
*/
#define debug(level, format...) _debug(__FILENAME__ , __LINE__, level, format)
/** @internal */
void _debug(const char *, int, int, const char *, ...);
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/apfree/xfrpc.git
git@gitee.com:apfree/xfrpc.git
apfree
xfrpc
xfrpc
master

搜索帮助