[busybox][RFC] syslogging errors

Tito farmatito at tiscali.it
Sat Jun 17 06:07:05 UTC 2006


On Friday 16 June 2006 22:59, Bernhard Fischer wrote:
> Hi,
> 
> [thinking about post 1.2.x cosmetic stuff a little bit..]
> 
> we have several places where we need (currently do and want to) log
> errors via syslog ({loginutils,init}/* comes to mind, network may do too
> as well as others).
> 
> Therefore i'm asking for a genericized facility to accomplish this task,
> resp. satisfy this need.
> 
> As a widely used facility, error_msg/perror_msg et al come to mind.
> Should we
> a) provide a globally exported int bb_log_level; to be used sd the
>    `syslog´ priority via bb_verror_msg()

Hi, 
if I remember correctly there was something like this in libbb.
Yeah, here is it:

file:/busybox-0.60/libbb/syslog_msg_with_name.c

#include <stdio.h>
#include <sys/syslog.h>
#include "libbb.h"

void syslog_msg_with_name(const char *name, int facility, int pri, const char *msg)
{
 	openlog(name, 0, facility);
	syslog(pri, "%s", msg);
	closelog();
}

void syslog_msg(int facility, int pri, const char *msg)
{
 	syslog_msg_with_name(applet_name, facility, pri, msg);
}

I don't know when and why it was ripped out, but i'm sure it was not very flexible
as I tried to use it in devfsd with no success.
Maybe something using vsyslog  and doing the die stuff would be better.

Ciao,
Tito

> b) a separate bb_sverror_msg() or
> c) do something else?
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://busybox.net/cgi-bin/mailman/listinfo/busybox
> 



More information about the busybox mailing list