diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-25 23:54:03 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-25 23:54:03 +0000 |
commit | a83bcff2d6c3b1c78e0227b804ed3412a755a3e1 (patch) | |
tree | 0e85e32dc0a7225bc4fdc6b8eef2c44f4ffdfde0 /include/asterisk/syslog.h | |
parent | 2810ae6ca7e93161901d8023f2b22cf3d211fee9 (diff) |
Move syslog utility functions into a separate file so they can be re-used.
This has the pleasant side effect of cleaning up the header inclusion process
in logger.c.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203508 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/syslog.h')
-rw-r--r-- | include/asterisk/syslog.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/include/asterisk/syslog.h b/include/asterisk/syslog.h new file mode 100644 index 000000000..ca8ea8fc6 --- /dev/null +++ b/include/asterisk/syslog.h @@ -0,0 +1,71 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2009, malleable, LLC. + * + * Sean Bright <sean@malleable.com> + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*! + * \file syslog.h + * \brief Syslog support functions for Asterisk logging. + */ + +#ifndef _ASTERISK_SYSLOG_H +#define _ASTERISK_SYSLOG_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +/*! + * \since 1.6.3 + * \brief Maps a syslog facility name from a string to a syslog facility + * constant. + * + * \param facility Facility name to map (i.e. "daemon") + * + * \retval syslog facility constant (i.e. LOG_DAEMON) if found + * \retval -1 if facility is not found + */ +int ast_syslog_facility(const char *facility); + +/*! + * \since 1.6.3 + * \brief Maps a syslog priority name from a string to a syslog priority + * constant. + * + * \param priority Priority name to map (i.e. "notice") + * + * \retval syslog priority constant (i.e. LOG_NOTICE) if found + * \retval -1 if priority is not found + */ +int ast_syslog_priority(const char *priority); + +/*! + * \since 1.6.3 + * \brief Maps an Asterisk log level (i.e. LOG_ERROR) to a syslog priority + * constant. + * + * \param level Asterisk log level constant (i.e. LOG_ERROR) + * + * \retval syslog priority constant (i.e. LOG_ERR) if found + * \retval -1 if priority is not found + */ +int ast_syslog_priority_from_loglevel(int level); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* _ASTERISK_SYSLOG_H */ |