mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
doc updates and copyright header cleanup (issue #5027)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1,15 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
* Cheops Next Generation
|
* Asterisk
|
||||||
*
|
*
|
||||||
* Mark Spencer <markster@marko.net>
|
* Mark Spencer <markster@digium.com>
|
||||||
*
|
*
|
||||||
* Copyright(C) Mark Spencer
|
* Copyright(C) 1999-2005, Digium, Inc.
|
||||||
*
|
*
|
||||||
* Distributed under the terms of the GNU General Public License (GPL) Version
|
* Distributed under the terms of the GNU General Public License (GPL) Version 2
|
||||||
*
|
*
|
||||||
* Logging routines
|
* Logging routines
|
||||||
*
|
*
|
||||||
|
* $Revision$
|
||||||
*/
|
*/
|
||||||
|
/*!
|
||||||
|
\file logger.h
|
||||||
|
\brief Support for logging to various files, console and syslog
|
||||||
|
Configuration in file logger.conf
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef _LOGGER_H
|
#ifndef _LOGGER_H
|
||||||
#define _LOGGER_H
|
#define _LOGGER_H
|
||||||
@@ -30,14 +36,17 @@ extern "C" {
|
|||||||
|
|
||||||
/*! Used for sending a log message */
|
/*! Used for sending a log message */
|
||||||
/*!
|
/*!
|
||||||
* \param level don't need to worry about it
|
\brief This is the standard logger function. Probably the only way you will invoke it would be something like this:
|
||||||
* \param file ditto
|
ast_log(LOG_WHATEVER, "Problem with the %s Captain. We should get some more. Will %d be enough?", "flux capacitor", 10);
|
||||||
* \param line ditto
|
where WHATEVER is one of ERROR, DEBUG, EVENT, NOTICE, or WARNING depending
|
||||||
* \param function ditto
|
on which log you wish to output to. These are implemented as macros, that
|
||||||
* \param fmt this is what is important. The format is the same as your favorite breed of printf. You know how that works, right? :-)
|
will provide the function with the needed arguments.
|
||||||
* This is the standard logger function. Probably the only way you will invoke it would be something like this:
|
|
||||||
* ast_log(LOG_WHATEVER, "Problem with the %s Captain. We should get some more. Will %d be enough?", "flux capacitor", 10);
|
\param level Type of log event
|
||||||
* where WHATEVER is one of ERROR, DEBUG, EVENT, NOTICE, or WARNING depending on which log you wish to output to.
|
\param file Will be provided by the LOG_* macro
|
||||||
|
\param line Will be provided by the LOG_* macro
|
||||||
|
\param function Will be provided by the LOG_* macro
|
||||||
|
\param fmt This is what is important. The format is the same as your favorite breed of printf. You know how that works, right? :-)
|
||||||
*/
|
*/
|
||||||
extern void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
|
extern void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
|
||||||
__attribute__ ((format (printf, 5, 6)));
|
__attribute__ ((format (printf, 5, 6)));
|
||||||
@@ -45,13 +54,12 @@ extern void ast_log(int level, const char *file, int line, const char *function,
|
|||||||
extern void ast_queue_log(const char *queuename, const char *callid, const char *agent, const char *event, const char *fmt, ...)
|
extern void ast_queue_log(const char *queuename, const char *callid, const char *agent, const char *event, const char *fmt, ...)
|
||||||
__attribute__ ((format (printf, 5, 6)));
|
__attribute__ ((format (printf, 5, 6)));
|
||||||
|
|
||||||
/*! Send a verbose message (based on verbose level) */
|
/*! Send a verbose message (based on verbose level)
|
||||||
/*!
|
\brief This works like ast_log, but prints verbose messages to the console depending on verbosity level set.
|
||||||
* This works like ast_log, but prints verbose messages to the console depending on verbosity level set.
|
ast_verbose(VERBOSE_PREFIX_3 "Whatever %s is happening\n", "nothing");
|
||||||
* ast_verbose(VERBOSE_PREFIX_3 "Whatever %s is happening\n", "nothing");
|
This will print the message to the console if the verbose level is set to a level >= 3
|
||||||
* This will print the message to the console if the verbose level is set to a level >= 3
|
Note the abscence of a comma after the VERBOSE_PREFIX_3. This is important.
|
||||||
* Note the abscence of a comma after the VERBOSE_PREFIX_3. This is important.
|
VERBOSE_PREFIX_1 through VERBOSE_PREFIX_3 are defined.
|
||||||
* VERBOSE_PREFIX_1 through VERBOSE_PREFIX_3 are defined.
|
|
||||||
*/
|
*/
|
||||||
extern void ast_verbose(const char *fmt, ...)
|
extern void ast_verbose(const char *fmt, ...)
|
||||||
__attribute__ ((format (printf, 1, 2)));
|
__attribute__ ((format (printf, 1, 2)));
|
||||||
|
Reference in New Issue
Block a user