summaryrefslogtreecommitdiffstats
path: root/apps/nshlib
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-10-08 11:34:22 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-10-08 11:34:22 -0600
commit59ac0e4d0352fad72b80018438e350ba405294b5 (patch)
treee11ebcb862370c10e4d8633d77673d4377d51a66 /apps/nshlib
parent68c842108f9509299434ceb6f1595f0e4ddd4505 (diff)
Update everything under apps/ to use the corrected syslog interfaces
Diffstat (limited to 'apps/nshlib')
-rw-r--r--apps/nshlib/nsh_usbtrace.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/apps/nshlib/nsh_usbtrace.c b/apps/nshlib/nsh_usbtrace.c
index 09f4df7e66..86341552e3 100644
--- a/apps/nshlib/nsh_usbtrace.c
+++ b/apps/nshlib/nsh_usbtrace.c
@@ -49,18 +49,6 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
-/* Output USB trace data to the console device using printf() unless (1)
- * debug is enabled, then we want to keep the trace output in sync with the
- * debug output by using syslog()we are using a USB console. In that case,
- * we don't want the trace output on the USB console; let's try sending it
- * a SYSLOG device (hopefully one is set up!)
- */
-
-#if defined(CONFIG_DEBUG) || defined(HAVE_USB_CONSOLE)
-# define trmessage syslog
-#else
-# define trmessage printf
-#endif
/****************************************************************************
* Private Types
@@ -94,9 +82,30 @@
*
****************************************************************************/
+static int usbtrace_syslog(FAR const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+
+ /* Let vsyslog do the real work */
+
+ va_start(ap, fmt);
+ ret = vsyslog(LOG_INFO, fmt, ap);
+ va_end(ap);
+ return ret;
+}
+
+/****************************************************************************
+ * Name: nsh_tracecallback
+ *
+ * Description:
+ * This is part of the USB trace logic
+ *
+ ****************************************************************************/
+
static int nsh_tracecallback(struct usbtrace_s *trace, void *arg)
{
- usbtrace_trprintf((trprintf_t)trmessage, trace->event, trace->value);
+ usbtrace_trprintf(usbtrace_syslog, trace->event, trace->value);
return 0;
}