add log
This commit is contained in:
parent
810044e134
commit
f25852d903
1 changed files with 13 additions and 0 deletions
13
pam/bin/pamlog.ml
Normal file
13
pam/bin/pamlog.ml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
open Syslog
|
||||||
|
|
||||||
|
let logger = openlog "PAM"
|
||||||
|
|
||||||
|
let _ = at_exit (fun () -> closelog logger)
|
||||||
|
|
||||||
|
let info msg =
|
||||||
|
print_endline [%string "INFO: %{msg}"];
|
||||||
|
syslog logger `LOG_INFO msg
|
||||||
|
|
||||||
|
let error msg =
|
||||||
|
print_endline [%string "ERROR: %{msg}"];
|
||||||
|
syslog logger `LOG_ERR msg
|
Loading…
Reference in a new issue