1--
2--  Copyright (c) 2008-2011,
3--  Reto Buerki, Adrian-Ken Rueegsegger
4--
5--  This file is part of Alog.
6--
7--  Alog is free software; you can redistribute it and/or modify
8--  it under the terms of the GNU Lesser General Public License as published
9--  by the Free Software Foundation; either version 2.1 of the License, or
10--  (at your option) any later version.
11--
12--  Alog is distributed in the hope that it will be useful,
13--  but WITHOUT ANY WARRANTY; without even the implied warranty of
14--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15--  GNU Lesser General Public License for more details.
16--
17--  You should have received a copy of the GNU Lesser General Public License
18--  along with Alog; if not, write to the Free Software
19--  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
20--  MA  02110-1301  USA
21
22--  Syslog facility: Used to log to systems syslog.
23package Alog.Facilities.Syslog is
24
25   type Instance is new Alog.Facilities.Instance with private;
26   --  Syslog based logging facility.
27
28   type Handle is access all Instance;
29
30   type Syslog_Origin is
31     (LOG_AUTH,
32      LOG_AUTHPRIV,
33      LOG_CRON,
34      LOG_DAEMON,
35      LOG_FTP,
36      LOG_KERN,
37      LOG_LOCAL0,
38      LOG_LOCAL1,
39      LOG_LOCAL2,
40      LOG_LOCAL3,
41      LOG_LOCAL4,
42      LOG_LOCAL5,
43      LOG_LOCAL6,
44      LOG_LOCAL7,
45      LOG_LPR,
46      LOG_MAIL,
47      LOG_NEWS,
48      LOG_SYSLOG,
49      LOG_USER,
50      LOG_UUCP);
51   --  Syslog facilties. Specifies what type of program is logging the message.
52
53   procedure Set_Origin
54     (Facility : in out Instance;
55      Value    :        Syslog_Origin);
56   --  Set origin of syslog message.
57
58   function Get_Origin (Facility : Instance) return Syslog_Origin;
59   --  Return currently set syslog origin of given facility.
60
61private
62
63   overriding
64   procedure Write
65     (Facility : Instance;
66      Level    : Log_Level := Info;
67      Msg      : String);
68   --  Implementation of the Write procedure for syslog.
69
70   type Instance is new Alog.Facilities.Instance with record
71      Origin : Syslog_Origin := LOG_USER;
72   end record;
73
74end Alog.Facilities.Syslog;
75