🚧 echo password

pull/548/head
微凉 2022-02-04 14:58:48 +08:00
parent 7804cf9d5c
commit 86cda58b22
2 changed files with 5 additions and 2 deletions

View File

@ -22,7 +22,7 @@ func Init() bool {
log.Errorf(err.Error()) log.Errorf(err.Error())
return false return false
} }
log.Infof("current password: %s", pass.Value) fmt.Printf("your password: %s\n", pass.Value)
return false return false
} }
server.InitIndex() server.InitIndex()

View File

@ -12,6 +12,9 @@ func InitLog() {
log.SetLevel(log.DebugLevel) log.SetLevel(log.DebugLevel)
log.SetReportCaller(true) log.SetReportCaller(true)
} }
if conf.Password {
log.SetLevel(log.WarnLevel)
}
log.SetFormatter(&log.TextFormatter{ log.SetFormatter(&log.TextFormatter{
//DisableColors: true, //DisableColors: true,
ForceColors: true, ForceColors: true,
@ -29,4 +32,4 @@ func init() {
flag.BoolVar(&conf.Password, "password", false, "print current password") flag.BoolVar(&conf.Password, "password", false, "print current password")
flag.Parse() flag.Parse()
InitLog() InitLog()
} }