A probably better way is to use syslog() calls in your program. The problem
with writing to a log file is that by default the writes are buffered, so if
your program crashes you will probably lose the last buffer full of error
messages.
Once you are writing messages out using syslog() you can then configure the
syslogd to write a file for your or even send to to a remote machine.
--- In Petr ©tetiar <> wrote:
>
> Achim <> [2009-12-29 01:15:36]:
>
> Hi,
>
> > Do anybody recommend a library/handler beneficial in embedded C programming
> > for logging? I need one for a controller running on TS-7800 under Debian
> > Linux. My application is working fine, but showing any Error/Warning/Trace
> > only as printf on the console. Whenever I start it in background the output
> > is gone...
>
> You can redirect that output to some log file:
>
> /usr/bin/application > /var/log/application.log 2>&1
>
> > - Saving Fatal, Errors, Warnings, Infos and Traces into a file or SQL
> > database - automatically remove old data from that file/database, like in
> > round-robin datasets - beside the message, also save a timestamp and the
> > function name - allow to search and browse within the saved log, including
> > filtering - allow a "live view" to show what happens now, like printf do -
> > configuration of saved level (e.g. only fatal and error, no warning or no
> > trace) based on file or function name - reduce saved/showed messages by
> > bundling these one which appears very often together in one message.
>
> I would use SQLite, you can do almost all that using standard SQL statements.
>
> > I already found nagius and cacti, but it looks as they only offer viewing
> > capabilities and not address logging.
>
> Those are overkill for embedded systems.
>
> -- ynezz
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|