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 {
62
62
DisableGit bool `long:"no-git" description:"disable the load of git standard repositories."`
63
63
DisableSiva bool `long:"no-siva" description:"disable the load of siva files."`
64
64
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"`
65
66
}
66
67
67
68
type jaegerLogrus struct {
@@ -107,6 +108,12 @@ func NewDatabaseEngine(
107
108
func (c * Server ) Execute (args []string ) error {
108
109
if c .Verbose {
109
110
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 )
110
117
}
111
118
112
119
var err error
@@ -127,7 +134,7 @@ func (c *Server) Execute(args []string) error {
127
134
c .userAuth = auth .NewNativeSingle (c .User , c .Password , permissions )
128
135
}
129
136
130
- c .userAuth = auth .NewAudit (c .userAuth , auth .NewAuditLog (logrus .New ()))
137
+ c .userAuth = auth .NewAudit (c .userAuth , auth .NewAuditLog (logrus .StandardLogger ()))
131
138
if err := c .buildDatabase (); err != nil {
132
139
logrus .WithField ("error" , err ).Fatal ("unable to initialize database engine" )
133
140
return err
You can’t perform that action at this time.
0 commit comments