File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ type Server struct {
6262 DisableGit bool `long:"no-git" description:"disable the load of git standard repositories."`
6363 DisableSiva bool `long:"no-siva" description:"disable the load of siva files."`
6464 Verbose bool `short:"v" description:"Activates the verbose mode"`
65+ LogLevel string `long:"log-level" env:"GITBASE_LOG_LEVEL" choice:"info" choice:"debug" choice:"warning" choice:"error" choice:"fatal" default:"info" description:"logging level"`
6566}
6667
6768type jaegerLogrus struct {
@@ -107,6 +108,12 @@ func NewDatabaseEngine(
107108func (c * Server ) Execute (args []string ) error {
108109 if c .Verbose {
109110 logrus .SetLevel (logrus .DebugLevel )
111+ } else {
112+ level , err := logrus .ParseLevel (c .LogLevel )
113+ if err != nil {
114+ return fmt .Errorf ("cannot parse log level: %s" , err .Error ())
115+ }
116+ logrus .SetLevel (level )
110117 }
111118
112119 var err error
@@ -127,7 +134,7 @@ func (c *Server) Execute(args []string) error {
127134 c .userAuth = auth .NewNativeSingle (c .User , c .Password , permissions )
128135 }
129136
130- c .userAuth = auth .NewAudit (c .userAuth , auth .NewAuditLog (logrus .New ()))
137+ c .userAuth = auth .NewAudit (c .userAuth , auth .NewAuditLog (logrus .StandardLogger ()))
131138 if err := c .buildDatabase (); err != nil {
132139 logrus .WithField ("error" , err ).Fatal ("unable to initialize database engine" )
133140 return err
You can’t perform that action at this time.
0 commit comments