From 86cda58b22e11c159646646830292bba2a966e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=AE=E5=87=89?= Date: Fri, 4 Feb 2022 14:58:48 +0800 Subject: [PATCH] :construction: echo password --- alist.go | 2 +- bootstrap/log.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/alist.go b/alist.go index c62f2921..e43f4b9d 100644 --- a/alist.go +++ b/alist.go @@ -22,7 +22,7 @@ func Init() bool { log.Errorf(err.Error()) return false } - log.Infof("current password: %s", pass.Value) + fmt.Printf("your password: %s\n", pass.Value) return false } server.InitIndex() diff --git a/bootstrap/log.go b/bootstrap/log.go index e8ac6918..a2548964 100644 --- a/bootstrap/log.go +++ b/bootstrap/log.go @@ -12,6 +12,9 @@ func InitLog() { log.SetLevel(log.DebugLevel) log.SetReportCaller(true) } + if conf.Password { + log.SetLevel(log.WarnLevel) + } log.SetFormatter(&log.TextFormatter{ //DisableColors: true, ForceColors: true, @@ -29,4 +32,4 @@ func init() { flag.BoolVar(&conf.Password, "password", false, "print current password") flag.Parse() InitLog() -} \ No newline at end of file +}