Update everything under nuttx/net to use the corrected syslog interfaces

This commit is contained in:
Gregory Nutt 2014-10-08 10:48:11 -06:00
parent e493e087a2
commit 0abe6c66d7
2 changed files with 14 additions and 45 deletions

View File

@ -54,22 +54,6 @@
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/* Select the lowest level debug interface available */
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_ARCH_LOWPUTC
# define message(format, ...) lowsyslog(format, ##__VA_ARGS__)
# else
# define message(format, ...) syslog(format, ##__VA_ARGS__)
# endif
#else
# ifdef CONFIG_ARCH_LOWPUTC
# define message lowsyslog
# else
# define message syslog
# endif
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -93,7 +77,7 @@ void iob_dump(FAR const char *msg, FAR struct iob_s *iob, unsigned int len,
unsigned int cndx;
head = iob;
message("%s: iob=%p pktlen=%d\n", msg, head, head->io_pktlen);
lowsyslog(LOG_DEBUG, "%s: iob=%p pktlen=%d\n", msg, head, head->io_pktlen);
/* Check if the offset is beyond the data in the I/O buffer chain */
@ -108,7 +92,8 @@ void iob_dump(FAR const char *msg, FAR struct iob_s *iob, unsigned int len,
for (; iob; iob = iob->io_flink)
{
message(" iob=%p len=%d offset=%d\n", iob, iob->io_len, iob->io_offset);
lowsyslog(LOG_DEBUG, " iob=%p len=%d offset=%d\n",
iob, iob->io_len, iob->io_offset);
}
/* Get the amount of data to be displayed, limited by the amount that we
@ -132,47 +117,47 @@ void iob_dump(FAR const char *msg, FAR struct iob_s *iob, unsigned int len,
if (nbytes > 0)
{
message(" %04x: ", offset);
lowsyslog(LOG_DEBUG, " %04x: ", offset);
for (cndx = 0; cndx < 32; cndx++)
{
if (cndx == 16)
{
message(" ");
lowsyslog(LOG_DEBUG, " ");
}
if ((lndx + cndx) < len)
{
message("%02x", data[cndx]);
lowsyslog(LOG_DEBUG, "%02x", data[cndx]);
}
else
{
message(" ");
lowsyslog(LOG_DEBUG, " ");
}
}
message(" ");
lowsyslog(LOG_DEBUG, " ");
for (cndx = 0; cndx < 32; cndx++)
{
if (cndx == 16)
{
message(" ");
lowsyslog(LOG_DEBUG, " ");
}
if ((lndx + cndx) < len)
{
if (data[cndx] >= 0x20 && data[cndx] < 0x7f)
{
message("%c", data[cndx]);
lowsyslog(LOG_DEBUG, "%c", data[cndx]);
}
else
{
message(".");
lowsyslog(LOG_DEBUG, ".");
}
}
}
message("\n");
lowsyslog(LOG_DEBUG, "\n");
}
}
}

View File

@ -52,22 +52,6 @@
* Pre-processor definitions
****************************************************************************/
/* Select the lowest level debug interface available */
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_ARCH_LOWPUTC
# define message(format, ...) lowsyslog(format, ##__VA_ARGS__)
# else
# define message(format, ...) syslog(format, ##__VA_ARGS__)
# endif
#else
# ifdef CONFIG_ARCH_LOWPUTC
# define message lowsyslog
# else
# define message syslog
# endif
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -83,8 +67,8 @@
void tcp_wrbuffer_dump(FAR const char *msg, FAR struct tcp_wrbuffer_s *wrb,
unsigned int len, unsigned int offset)
{
message("%s: wrb=%p segno=%d sent=%d nrtx=%d\n",
msg, wrb, WRB_SEQNO(wrb), WRB_SENT(wrb), WRB_NRTX(wrb));
lowsyslog(LOG_DEBUG, "%s: wrb=%p segno=%d sent=%d nrtx=%d\n",
msg, wrb, WRB_SEQNO(wrb), WRB_SENT(wrb), WRB_NRTX(wrb));
iob_dump("I/O Buffer Chain", WRB_IOB(wrb), len, offset);
}