summaryrefslogtreecommitdiff
path: root/src/include/syslogdevice.h
blob: 68d41120ac7302c3a94bf55d922a7b226bddc194 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/** --------------------------------------------------------------------
 *  @file Syslogdevice.h
 *  @brief Declaration of the SyslogDevice class.
 *  @author Andreas Aardal Hanssen
 *  @date 2002, 2003
 *  -----------------------------------------------------------------  **/
#ifndef syslogdevice_h_included
#define syslogdevice_h_included

#include "iodevice.h"

#include <syslog.h>

namespace Binc {
  class SyslogDevice : public IODevice {
  public:
    SyslogDevice(int flags,
                 const char *ident = "bincimap",
                 int option = LOG_NDELAY | LOG_PID,
                 int facility = LOG_USER);
    ~SyslogDevice();

    void setPriority(int p);

    std::string service(void) const;

  protected:
    bool waitForWrite(void) const;
    bool waitForRead(void) const;

    WriteResult write(void);
    bool fillInputBuffer(void);

  private:
    static std::string ident;

    int option;
    int facility;
    int priority;
  };
}

#endif