From 62a1be15b7e5e1e7d002a6ab4ccbe9c977f1797d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Sat, 26 Nov 2016 11:52:14 +0100 Subject: [PATCH] Shell: still allow usage of `LWT_LOG` Commit b869c264aa introdude `-v level`, which should be equivalent to setting `LWT_LOG="* -> level`, but it inadvertently drop the support for `LWT_LOG`. This commit reintroduces support for ` LWT_LOG` which allows to setup distinct verbosity levels to distinct part of the node : LWT_LOG="net -> debug ; rpc -> notice" --- src/node_main.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/node_main.ml b/src/node_main.ml index 33e738720..6cdd90c1b 100644 --- a/src/node_main.ml +++ b/src/node_main.ml @@ -102,7 +102,7 @@ module Globals = struct sandbox#add_hook sandboxed let verbose_param = - new string_option_cp ~group:cli_group ["verbosity"] ~short_name:"v" (Some "notice") + new string_option_cp ~group:cli_group ["verbosity"] ~short_name:"v" None "Verbosity level (fatal, error, warning, notice, info, debug)" (** File options *) @@ -233,7 +233,9 @@ let init_logger () = | Some "notice" -> add_rule "*" Notice | Some "info" -> add_rule "*" Info | Some "debug" -> add_rule "*" Debug - | _ -> () + | Some level -> + Printf.eprintf "Warning: unknown verbosity level \"%s\".\n%!" level + | None -> () end; match Globals.log_kind#get with | "" | "stderr" -> Logging.init Stderr