fix: admin console logger changes to log.Info

This commit is contained in:
Harshavardhana
2020-03-20 15:13:41 -07:00
parent ae654831aa
commit b4bfdc92cc
4 changed files with 22 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
/*
* MinIO Cloud Storage, (C) 2018 MinIO, Inc.
* MinIO Cloud Storage, (C) 2018, 2020 MinIO, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
package log
import "strings"
// Args - defines the arguments for the API.
type Args struct {
Bucket string `json:"bucket,omitempty"`
@@ -58,3 +60,10 @@ type Info struct {
NodeName string `json:"node"`
Err error `json:"-"`
}
// SendLog returns true if log pertains to node specified in args.
func (l Info) SendLog(node, logKind string) bool {
nodeFltr := (node == "" || strings.EqualFold(node, l.NodeName))
typeFltr := strings.EqualFold(logKind, "all") || strings.EqualFold(l.LogKind, logKind)
return nodeFltr && typeFltr
}