summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--context_mirror_bot.ml6
1 files changed, 4 insertions, 2 deletions
diff --git a/context_mirror_bot.ml b/context_mirror_bot.ml
index 62ef5e0..61d3535 100644
--- a/context_mirror_bot.ml
+++ b/context_mirror_bot.ml
@@ -27,6 +27,8 @@
let t_start = Unix.gettimeofday ()
+let self = Filename.basename Sys.argv.(0)
+
type context_src = {
name : string;
url : string;
@@ -194,7 +196,7 @@ let msg ?lev:(lev=0) str =
let err str =
Printf.eprintf "[bot %s: error] %s\n%!" (timestamp ()) str
-let logger = Filename.basename Sys.argv.(0) |> Syslog.openlog ;;
+let logger = Syslog.openlog self
let log_info msg =
Syslog.syslog logger `LOG_INFO msg
@@ -670,7 +672,7 @@ let handle_zipball = function
let usage = Printf.sprintf "Usage:
%s [ --check | --status | --update ]
-" Sys.argv.(0)
+" self
let run_status () =
if not (dir_exists repo_dir) then msg ("No directory at " ^ repo_dir) else