File: syslog_test.ml

package info (click to toggle)
approx 4.5-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 428 kB
  • ctags: 683
  • sloc: ml: 1,957; sh: 45; makefile: 36
file content (14 lines) | stat: -rw-r--r-- 428 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
(* approx: proxy server for Debian archive files
   Copyright (C) 2009  Eric C. Cooper <ecc@cmu.edu>
   Released under the GNU General Public License *)

open Printf
open Syslog

let msg =
  match Array.length Sys.argv with
  | 1 -> eprintf "Usage: %s message ...\n" Sys.argv.(0); exit 1
  | n -> String.concat " " (Array.to_list (Array.sub Sys.argv 1 (n - 1)))

let log = openlog Sys.argv.(0)
let () = syslog log `LOG_INFO msg