log: Use error log type instead of Application/MinIO type (#18930)

* log: Use error log type instead of Application/MinIO type

Also bump github.com/shirou/gopsutil version to address cross
compilation issues.

* Apply suggestions from code review

Co-authored-by: Aditya Manthramurthy <donatello@users.noreply.github.com>

---------

Co-authored-by: Anis Eleuch <anis@min.io>
Co-authored-by: Harshavardhana <harsha@minio.io>
Co-authored-by: Aditya Manthramurthy <donatello@users.noreply.github.com>
This commit is contained in:
Anis Eleuch
2024-02-02 01:13:57 +01:00
committed by GitHub
parent 59cc3e93d6
commit 6fd63e920a
19 changed files with 63 additions and 79 deletions
+5 -5
View File
@@ -91,7 +91,7 @@ func (f fatalMsg) json(msg string, args ...interface{}) {
message = fmt.Sprint(args...)
}
logJSON, err := json.Marshal(&log.Entry{
Level: FatalLvl.String(),
Level: FatalKind,
Message: message,
Time: time.Now().UTC(),
Trace: &log.Trace{Message: message, Source: []string{getSource(6)}},
@@ -169,7 +169,7 @@ func (i infoMsg) json(msg string, args ...interface{}) {
message = fmt.Sprint(args...)
}
logJSON, err := json.Marshal(&log.Entry{
Level: InfoLvl.String(),
Level: InfoKind,
Message: message,
Time: time.Now().UTC(),
})
@@ -201,7 +201,7 @@ func (i errorMsg) json(msg string, args ...interface{}) {
message = fmt.Sprint(args...)
}
logJSON, err := json.Marshal(&log.Entry{
Level: ErrorLvl.String(),
Level: ErrorKind,
Message: message,
Time: time.Now().UTC(),
Trace: &log.Trace{Message: message, Source: []string{getSource(6)}},
@@ -225,7 +225,7 @@ func (i errorMsg) pretty(msg string, args ...interface{}) {
// Error :
func Error(msg string, data ...interface{}) {
if MinimumLogLevel > ErrorLvl {
if DisableErrorLog {
return
}
consoleLog(errorm, msg, data...)
@@ -233,7 +233,7 @@ func Error(msg string, data ...interface{}) {
// Info :
func Info(msg string, data ...interface{}) {
if MinimumLogLevel > InfoLvl {
if DisableErrorLog {
return
}
consoleLog(info, msg, data...)