#include <config.h>
#endif
#include <utils.h>
+#include <log.h>
+static int inited = 0;
static int tostderr = 1, tosyslog = 0;
+static void initlog(void)
+{
+ inited = 1;
+ if(getenv("ASHD_USESYSLOG") != NULL)
+ opensyslog();
+}
+
void flog(int level, char *format, ...)
{
va_list args;
+ if(!inited)
+ initlog();
va_start(args, format);
if(tostderr) {
vfprintf(stderr, format, args);
void opensyslog(void)
{
+ if(!inited)
+ initlog();
openlog("ashd", 0, LOG_DAEMON);
tostderr = 0;
tosyslog = 1;