mirror of https://github.com/minio/minio.git
Enable console logging when server debug is enabled (#13259)
_MINIO_SERVER_DEBUG will enable console logging.
This commit is contained in:
parent
f492f72154
commit
565d95a377
|
@ -182,16 +182,16 @@ func initConsoleServer() (*restapi.Server, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
noLog := func(string, ...interface{}) {
|
|
||||||
// nothing to log
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize MinIO loggers
|
|
||||||
restapi.LogInfo = noLog
|
|
||||||
restapi.LogError = noLog
|
|
||||||
|
|
||||||
api := operations.NewConsoleAPI(swaggerSpec)
|
api := operations.NewConsoleAPI(swaggerSpec)
|
||||||
api.Logger = noLog
|
|
||||||
|
if !serverDebugLog {
|
||||||
|
// Disable console logging if server debug log is not enabled
|
||||||
|
noLog := func(string, ...interface{}) {}
|
||||||
|
|
||||||
|
restapi.LogInfo = noLog
|
||||||
|
restapi.LogError = noLog
|
||||||
|
api.Logger = noLog
|
||||||
|
}
|
||||||
|
|
||||||
server := restapi.NewServer(api)
|
server := restapi.NewServer(api)
|
||||||
// register all APIs
|
// register all APIs
|
||||||
|
|
Loading…
Reference in New Issue