1 Star 0 Fork 0

MorSunChen/janus-gateway

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
log.h 1.86 KB
一键复制 编辑 原始数据 按行查看 历史
/*! \file log.h
* \author Jay Ridgeway <jayridge@gmail.com>
* \copyright GNU General Public License v3
* \brief Buffered logging (headers)
* \details Implementation of a simple buffered logger designed to remove
* I/O wait from threads that may be sensitive to such delays. Buffers are
* saved and reused to reduce allocation calls. The logger output can then
* be printed to stdout and/or a log file.
*
* \ingroup core
* \ref core
*/
#ifndef _JANUS_LOG_H
#define _JANUS_LOG_H
#include <stdio.h>
#include <glib.h>
/*! \brief Buffered vprintf
* @param[in] format Format string as defined by glib, followed by the
* optional parameters to insert into formatted string (printf style)
* \note This output is buffered and may not appear immediately on stdout. */
void janus_vprintf(const char *format, ...) G_GNUC_PRINTF(1, 2);
/*! \brief Log initialization
* \note This should be called before attempting to use the logger. A buffer
* pool and processing thread are created.
* @param daemon Whether the Janus is running as a daemon or not
* @param console Whether the output should be printed on stdout or not
* @param logfile Log file to save the output to, if any
* @returns 0 in case of success, a negative integer otherwise */
int janus_log_init(gboolean daemon, gboolean console, const char *logfile);
/*! \brief Log destruction */
void janus_log_destroy(void);
/*! \brief Method to check whether stdout logging is enabled
* @returns TRUE if stdout logging is enabled, FALSE otherwise */
gboolean janus_log_is_stdout_enabled(void);
/*! \brief Method to check whether file-based logging is enabled
* @returns TRUE if file-based logging is enabled, FALSE otherwise */
gboolean janus_log_is_logfile_enabled(void);
/*! \brief Method to get the path to the log file
* @returns The full path to the log file, or NULL otherwise */
char *janus_log_get_logfile_path(void);
#endif
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/MorsunJacky/janus-gateway.git
git@gitee.com:MorsunJacky/janus-gateway.git
MorsunJacky
janus-gateway
janus-gateway
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385