mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
Add support for a warn() marco that will be between dbg() and info() in priority
This commit is contained in:
@@ -413,9 +413,18 @@ if DEBUG
|
|||||||
|
|
||||||
comment "Debug SYSLOG Output Controls"
|
comment "Debug SYSLOG Output Controls"
|
||||||
|
|
||||||
config CONFIG_DEBUG_INFO
|
config DEBUG_WARNINGS
|
||||||
|
bool "Enable Warnings Output"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Enables output from warning statements. Warnings are considered to
|
||||||
|
be potential errors or errors that will not have serious
|
||||||
|
consequences.
|
||||||
|
|
||||||
|
config DEBUG_INFO
|
||||||
bool "Enable Informational Debug Output"
|
bool "Enable Informational Debug Output"
|
||||||
default n
|
default n
|
||||||
|
depends on DEBUG_WARNINGS
|
||||||
---help---
|
---help---
|
||||||
Enables verbose "informational" debug output. If you enable
|
Enables verbose "informational" debug output. If you enable
|
||||||
CONFIG_DEBUG_INFO, then very chatty (and often annoying) output
|
CONFIG_DEBUG_INFO, then very chatty (and often annoying) output
|
||||||
|
|||||||
+456
-293
File diff suppressed because it is too large
Load Diff
+32
-7
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* libc/misc/lib_dbg.c
|
* libc/misc/lib_dbg.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2011-2012, 2016 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -46,10 +46,6 @@
|
|||||||
|
|
||||||
#ifndef CONFIG_CPP_HAVE_VARARGS
|
#ifndef CONFIG_CPP_HAVE_VARARGS
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -82,13 +78,42 @@ int lldbg(const char *format, ...)
|
|||||||
va_list ap;
|
va_list ap;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
va_start(ap, format);
|
||||||
|
ret = lowvsyslog(LOG_ERR, format, ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_ARCH_LOWPUTC */
|
||||||
|
#endif /* CONFIG_DEBUG */
|
||||||
|
|
||||||
|
#ifdef CONFIG_DEBUG_WARN
|
||||||
|
int warn(const char *format, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
va_start(ap, format);
|
||||||
|
ret = vsyslog(LOG_WARNING, format, ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARCH_LOWPUTC
|
||||||
|
int llwarn(const char *format, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
int ret;
|
||||||
|
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
ret = lowvsyslog(LOG_DEBUG, format, ap);
|
ret = lowvsyslog(LOG_DEBUG, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* CONFIG_ARCH_LOWPUTC */
|
||||||
|
#endif /* CONFIG_DEBUG_INFO */
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_INFO
|
#ifdef CONFIG_DEBUG_INFO
|
||||||
int info(const char *format, ...)
|
int info(const char *format, ...)
|
||||||
@@ -117,5 +142,5 @@ int llinfo(const char *format, ...)
|
|||||||
}
|
}
|
||||||
#endif /* CONFIG_ARCH_LOWPUTC */
|
#endif /* CONFIG_ARCH_LOWPUTC */
|
||||||
#endif /* CONFIG_DEBUG_INFO */
|
#endif /* CONFIG_DEBUG_INFO */
|
||||||
#endif /* CONFIG_DEBUG */
|
|
||||||
#endif /* CONFIG_CPP_HAVE_VARARGS */
|
#endif /* CONFIG_CPP_HAVE_VARARGS */
|
||||||
|
|||||||
Reference in New Issue
Block a user