1/* 2 * Copyright 2003-2015, Axel D��rfler, axeld@pinc-software.de. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5#ifndef SYSLOG_DAEMON_H 6#define SYSLOG_DAEMON_H 7 8 9#include <OS.h> 10 11 12#define B_SYSTEM_LOGGER_SIGNATURE "application/x-vnd.Haiku-SystemLogger" 13 14#define SYSLOG_MESSAGE '_Syl' 15#define SYSLOG_ADD_LISTENER 'aSyl' 16#define SYSLOG_REMOVE_LISTENER 'rSyl' 17 18 19// This message is sent from both, the POSIX syslog API and the kernel's 20// dprintf() logging facility if logging to syslog was enabled. 21 22struct syslog_message { 23 thread_id from; 24 time_t when; 25 int32 options; 26 int16 priority; 27 char ident[B_OS_NAME_LENGTH]; 28 char message[1]; 29}; 30 31#define SYSLOG_MESSAGE_BUFFER_SIZE 8192 32#define SYSLOG_MAX_MESSAGE_LENGTH (SYSLOG_MESSAGE_BUFFER_SIZE - sizeof(struct syslog_message)) 33 34#define SYSLOG_PRIORITY(options) ((options) & 0x7) 35#define SYSLOG_FACILITY(options) ((options) & 0x03f8) 36#define SYSLOG_FACILITY_INDEX(options) (SYSLOG_FACILITY(options) >> 3) 37 38#endif /* SYSLOG_DAEMON_H */ 39