This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: remote syslog support in Redboot?
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Jon Ringle <JRingle at vertical dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Thu, 10 May 2007 13:56:17 +0200
- Subject: Re: [ECOS] remote syslog support in Redboot?
- References: <4DD3AF7ECBBC43409BA36508938D0185123B73@CVAEX1.VERTICAL.COM>
On Wed, May 09, 2007 at 03:12:29PM -0400, Jon Ringle wrote:
> Has anyone implemented the ability to have diag_printf() messages be
> sent to a remote syslog server in Redboot/ecos?
You will have to be careful when doing this. diag_printf() uses a very
simple polled IO, blocking serial device driver. The idea is that it
should always work, in any context. So you can do a diag_printf() in
an ISR or a DSR, not just a thread. It is also guaranteed the output
will be out the serial port before diag_printf() returns.
If you somehow modify diag_printf to send over a network stack it is
unlikely you can keep these properties. I would suggest you look at
adding a standard syslog interface, eg:
#include <syslog.h>
void openlog(const char *ident, int option, int facility);
void syslog(int priority, const char *format, ...);
void closelog(void);
#define _BSD_SOURCE
#include <stdarg.h>
void vsyslog(int priority, const char *format, va_list ap);
and don't modify diag_printf().
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss