Skip to content

Commit 5a439e6

Browse files
committed
daemon: add -logformat option to control logger
1 parent 9b233de commit 5a439e6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

daemon.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ let unless_exit x = Lwt.pick [wait_exit (); x]
6262
let get_args () =
6363
[
6464
("-loglevel", Arg.String Log.set_loglevels, " ([<facil|prefix*>=]debug|info|warn|error[,])+");
65+
("-logformat",
66+
Arg.Symbol (["plain"; "default"; "logfmt"], (function
67+
| "plain" | "default" -> Log.State.set_plaintext ()
68+
| "logfmt" -> Log.State.set_logfmt ()
69+
| s -> failwith (Printf.sprintf "unknown log format %S" s))),
70+
" Log output format (default: plain)");
6571
ExtArg.may_str "logfile" logfile "<file> Log file";
6672
ExtArg.may_str "pidfile" pidfile "<file> PID file";
6773
"-runas",

0 commit comments

Comments
 (0)