From 9bbfaf68fe0289003c1f7de64509b0abe88062ce Mon Sep 17 00:00:00 2001 From: kuba-- Date: Wed, 31 Oct 2018 11:16:02 +0100 Subject: [PATCH] No panic when could not find glog flag. Signed-off-by: kuba-- --- go/vt/logutil/level.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/go/vt/logutil/level.go b/go/vt/logutil/level.go index bf59a42dde6..86c61c868ea 100644 --- a/go/vt/logutil/level.go +++ b/go/vt/logutil/level.go @@ -23,11 +23,13 @@ import ( func init() { threshold := flag.Lookup("stderrthreshold") if threshold == nil { - panic("the logging module doesn't specify a stderrthreshold flag") + // the logging module doesn't specify a stderrthreshold flag + return } + const warningLevel = "1" if err := threshold.Value.Set(warningLevel); err != nil { - panic(err) + return } threshold.DefValue = warningLevel }