2003-11-12 17:31:34 +03:00
|
|
|
/*
|
2015-04-21 19:49:37 +03:00
|
|
|
* Copyright 2003-2015, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
2006-01-24 23:28:52 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2003-11-12 17:31:34 +03:00
|
|
|
#ifndef SYSLOG_DAEMON_H
|
|
|
|
#define SYSLOG_DAEMON_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <OS.h>
|
|
|
|
|
|
|
|
|
2015-04-21 19:49:37 +03:00
|
|
|
#define B_SYSTEM_LOGGER_SIGNATURE "application/x-vnd.Haiku-SystemLogger"
|
2003-11-13 04:15:46 +03:00
|
|
|
|
|
|
|
#define SYSLOG_MESSAGE '_Syl'
|
|
|
|
#define SYSLOG_ADD_LISTENER 'aSyl'
|
|
|
|
#define SYSLOG_REMOVE_LISTENER 'rSyl'
|
|
|
|
|
2003-11-12 17:31:34 +03:00
|
|
|
|
|
|
|
// This message is sent from both, the POSIX syslog API and the kernel's
|
|
|
|
// dprintf() logging facility if logging to syslog was enabled.
|
|
|
|
|
|
|
|
struct syslog_message {
|
|
|
|
thread_id from;
|
|
|
|
time_t when;
|
|
|
|
int32 options;
|
2003-11-12 19:35:19 +03:00
|
|
|
int16 priority;
|
2003-11-12 17:31:34 +03:00
|
|
|
char ident[B_OS_NAME_LENGTH];
|
|
|
|
char message[1];
|
|
|
|
};
|
|
|
|
|
2006-01-24 23:28:52 +03:00
|
|
|
#define SYSLOG_MESSAGE_BUFFER_SIZE 8192
|
|
|
|
#define SYSLOG_MAX_MESSAGE_LENGTH (SYSLOG_MESSAGE_BUFFER_SIZE - sizeof(struct syslog_message))
|
|
|
|
|
2003-11-12 19:35:19 +03:00
|
|
|
#define SYSLOG_PRIORITY(options) ((options) & 0x7)
|
|
|
|
#define SYSLOG_FACILITY(options) ((options) & 0x03f8)
|
2003-12-30 03:20:40 +03:00
|
|
|
#define SYSLOG_FACILITY_INDEX(options) (SYSLOG_FACILITY(options) >> 3)
|
2003-11-12 19:35:19 +03:00
|
|
|
|
2003-11-12 17:31:34 +03:00
|
|
|
#endif /* SYSLOG_DAEMON_H */
|