mirror of
https://github.com/pgsty/minio.git
synced 2026-07-21 05:00:22 +03:00
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:
@@ -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...)
|
||||
|
||||
Reference in New Issue
Block a user