added extra OUTPUT level

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2023-12-08 10:09:48 +01:00
committed by Jonathon Anderson
parent aaadf26b90
commit 5efaf6d9f5
2 changed files with 12 additions and 2 deletions

View File

@@ -125,7 +125,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support importing containers with symlinked `/bin/sh` #797
- Don't panic on malformed passwd #527
- Update iPXE building script
- wwlog.Info|Recv|Send will go to stdout, rest to stderr
- Send Info, Recv, Send, and Out messages to stdout; and others to stderr
## [4.4.0] 2023-01-18

View File

@@ -36,9 +36,11 @@ var (
ERROR = SetLevelName(40, "ERROR")
SECWARN = SetLevelName(31, "SECWARN")
WARN = SetLevelName(30, "WARN")
ERROUT = SetLevelName(29, "ERROUT")
SEND = SetLevelName(27, "SEND")
RECV = SetLevelName(26, "RECV")
SERV = SetLevelName(25, "SERV")
OUT = SetLevelName(22, "OUT")
SECINFO = SetLevelName(21, "SECINFO")
INFO = SetLevelName(20, "INFO")
SECVERBOSE = SetLevelName(16, "SECVERBOSE")
@@ -216,7 +218,7 @@ func LogCaller(level int, skip int, err error, message string, a ...interface{})
}
message = logFormatter(logLevel, &rec)
if level == INFO || level == RECV || level == SEND {
if level == INFO || level == RECV || level == SEND || level == OUT {
fmt.Fprint(logOut, message)
} else {
fmt.Fprint(logErr, message)
@@ -273,6 +275,10 @@ func Info(message string, a ...interface{}) {
LogCaller(INFO, 1, nil, message, a...)
}
func Output(message string, a ...interface{}) {
LogCaller(OUT, 1, nil, message, a...)
}
func InfoExc(err error, message string, a ...interface{}) {
LogCaller(INFO, 1, err, message, a...)
}
@@ -305,6 +311,10 @@ func SecWarn(message string, a ...interface{}) {
LogCaller(SECWARN, 1, nil, message, a...)
}
func ErrOut(message string, a ...interface{}) {
LogCaller(ERROUT, 1, nil, message, a...)
}
func Error(message string, a ...interface{}) {
LogCaller(ERROR, 1, nil, message, a...)
}