Add syslog.h; rename lib_rawprintf() to syslog()

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5578 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2013-01-28 21:55:16 +00:00
parent 433dae7422
commit 79ccfa4ae6
180 changed files with 677 additions and 520 deletions
+18 -18
View File
@@ -50,8 +50,8 @@
/* Debug output is initially disabled */
#ifdef CONFIG_DEBUG_ENABLE
bool g_dbgenable;
#ifdef CONFIG_SYSLOG_ENABLE
bool g_syslogenable;
#endif
/****************************************************************************
@@ -59,17 +59,17 @@ bool g_dbgenable;
****************************************************************************/
/****************************************************************************
* Name: dbg_enable
* Name: syslog_enable
*
* Description:
* Enable or disable debug output.
*
****************************************************************************/
#ifdef CONFIG_DEBUG_ENABLE
void dbg_enable(bool enable)
#ifdef CONFIG_SYSLOG_ENABLE
void syslog_enable(bool enable)
{
g_dbgenable = enable;
g_syslogenable = enable;
}
#endif
@@ -89,13 +89,13 @@ int dbg(const char *format, ...)
va_list ap;
int ret;
#ifdef CONFIG_DEBUG_ENABLE
#ifdef CONFIG_SYSLOG_ENABLE
ret = 0;
if (g_dbgenable)
if (g_syslogenable)
#endif
{
va_start(ap, format);
ret = lib_rawvprintf(format, ap);
ret = vsyslog(format, ap);
va_end(ap);
}
@@ -108,13 +108,13 @@ int lldbg(const char *format, ...)
va_list ap;
int ret;
#ifdef CONFIG_DEBUG_ENABLE
#ifdef CONFIG_SYSLOG_ENABLE
ret = 0;
if (g_dbgenable)
if (g_syslogenable)
#endif
{
va_start(ap, format);
ret = lib_lowvprintf(format, ap);
ret = lowvsyslog(format, ap);
va_end(ap);
}
@@ -128,13 +128,13 @@ int vdbg(const char *format, ...)
va_list ap;
int ret;
#ifdef CONFIG_DEBUG_ENABLE
#ifdef CONFIG_SYSLOG_ENABLE
ret = 0;
if (g_dbgenable)
if (g_syslogenable)
#endif
{
va_start(ap, format);
ret = lib_rawvprintf(format, ap);
ret = vsyslog(format, ap);
va_end(ap);
}
@@ -147,13 +147,13 @@ int llvdbg(const char *format, ...)
va_list ap;
int ret;
#ifdef CONFIG_DEBUG_ENABLE
#ifdef CONFIG_SYSLOG_ENABLE
ret = 0;
if (g_dbgenable)
if (g_syslogenable)
#endif
{
va_start(ap, format);
ret = lib_lowvprintf(format, ap);
ret = lowvsyslog(format, ap);
va_end(ap);
}
+4 -4
View File
@@ -51,15 +51,15 @@
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_ARCH_LOWPUTC
# define message(format, arg...) lib_lowprintf(format, ##arg)
# define message(format, arg...) lowsyslog(format, ##arg)
# else
# define message(format, arg...) lib_rawprintf(format, ##arg)
# define message(format, arg...) syslog(format, ##arg)
# endif
#else
# ifdef CONFIG_ARCH_LOWPUTC
# define message lib_lowprintf
# define message lowsyslog
# else
# define message lib_rawprintf
# define message syslog
# endif
#endif