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 facility = Auth | Authpriv | Cron | Daemon | Ftp | Kern
17              | Local0 | Local1 | Local2 | Local3
18	      | Local4 | Local5 | Local6 | Local7
19	      | Lpr | Mail | News | Syslog | User | Uucp
20
21external log : facility -> level -> string -> unit = "stub_syslog"
22
23exception Unknown_facility of string
24let facility_of_string s =
25	match s with
26    |"auth"->Auth
27    |"authpriv"->Authpriv
28    |"cron"->Cron
29    |"daemon"->Daemon
30    |"ftp"->Ftp
31    |"kern"->Kern
32    |"local0"->Local0
33    |"local1"->Local1
34    |"local2"->Local2
35    |"local3"->Local3
36    |"local4"->Local4
37    |"local5"->Local5
38    |"local6"->Local6
39    |"local7"->Local7
40    |"lpr"->Lpr
41    |"mail"->Mail
42    |"news"->News
43    |"syslog"->Syslog
44    |"user"->User
45    |"uucp"->Uucp
46		|_-> raise (Unknown_facility s)
47