1(*
2 * Copyright (C) 2006-2009 Citrix Systems Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published
6 * by the Free Software Foundation; version 2.1 only. with the special
7 * exception on linking described in file LICENSE.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU Lesser General Public License for more details.
13 *)
14
15type level = Emerg | Alert | Crit | Err | Warning | Notice | Info | Debug
16type options = Cons | Ndelay | Nowait | Odelay | Perror | Pid
17type facility = Auth | Authpriv | Cron | Daemon | Ftp | Kern
18              | Local0 | Local1 | Local2 | Local3
19	      | Local4 | Local5 | Local6 | Local7
20	      | Lpr | Mail | News | Syslog | User | Uucp
21
22external log : facility -> level -> string -> unit = "stub_syslog"
23
24exception Unknown_facility of string
25let facility_of_string s =
26	match s with
27    |"auth"->Auth
28    |"authpriv"->Authpriv
29    |"cron"->Cron
30    |"daemon"->Daemon
31    |"ftp"->Ftp
32    |"kern"->Kern
33    |"local0"->Local0
34    |"local1"->Local1
35    |"local2"->Local2
36    |"local3"->Local3
37    |"local4"->Local4
38    |"local5"->Local5
39    |"local6"->Local6
40    |"local7"->Local7
41    |"lpr"->Lpr
42    |"mail"->Mail
43    |"news"->News
44    |"syslog"->Syslog
45    |"user"->User
46    |"uucp"->Uucp
47		|_-> raise (Unknown_facility s)
48