it currently only puts out everything to stdout. Is able to accept listeners who will get the syslog notes as well. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5340 a95241bf-73f2-0310-859d-f6bbb57e9c96
43 lines
801 B
C++
43 lines
801 B
C++
/*
|
|
** Copyright 2003, Axel Dörfler, [email protected]. All rights reserved.
|
|
** Distributed under the terms of the OpenBeOS License.
|
|
*/
|
|
#ifndef _SYSLOG_DAEMON_H_
|
|
#define _SYSLOG_DAEMON_H_
|
|
|
|
|
|
#include <Application.h>
|
|
#include <Locker.h>
|
|
#include <List.h>
|
|
#include <OS.h>
|
|
|
|
#include <syslog_daemon.h>
|
|
|
|
|
|
typedef void (*handler_func)(syslog_message &);
|
|
|
|
|
|
class SyslogDaemon : public BApplication {
|
|
public:
|
|
SyslogDaemon();
|
|
|
|
virtual void ReadyToRun();
|
|
virtual void AboutRequested();
|
|
virtual bool QuitRequested();
|
|
virtual void MessageReceived(BMessage *msg);
|
|
|
|
void AddHandler(handler_func function);
|
|
|
|
void Daemon();
|
|
static int32 daemon_thread(void *data);
|
|
|
|
private:
|
|
thread_id fDaemon;
|
|
port_id fPort;
|
|
|
|
BLocker fHandlerLock;
|
|
BList fHandlers;
|
|
};
|
|
|
|
#endif /* _SYSLOG_DAEMON_H_ */
|