1
0
mirror of https://github.com/taigrr/log-socket synced 2025-01-18 04:53:14 -08:00

Adds Notice logging level to support NATS

This commit is contained in:
Tai Groot 2021-08-23 20:58:15 -07:00
parent d21c91379e
commit f51ec53a89
Signed by: taigrr
GPG Key ID: D00C269A87614812
2 changed files with 27 additions and 0 deletions

View File

@ -199,6 +199,32 @@ func Infof(format string, args ...interface{}) {
createLog(e) createLog(e)
} }
// Info prints out logs on info level
func Noticef(args ...interface{}) {
output := fmt.Sprint(args...)
e := Entry{
Timestamp: time.Now(),
Output: output,
File: fileInfo(2),
Level: "NOTICE",
level: LNotice,
}
createLog(e)
}
// Formatted print for Info
func Noticef(format string, args ...interface{}) {
output := fmt.Sprintf(format, args...)
e := Entry{
Timestamp: time.Now(),
Output: output,
File: fileInfo(2),
Level: "NOTICE",
level: LNotice,
}
createLog(e)
}
// Warn prints out logs on warn level // Warn prints out logs on warn level
func Warn(args ...interface{}) { func Warn(args ...interface{}) {
output := fmt.Sprint(args...) output := fmt.Sprint(args...)

View File

@ -9,6 +9,7 @@ const (
LTrace Level = iota LTrace Level = iota
LDebug LDebug
LInfo LInfo
LNotice
LWarn LWarn
LError LError
LPanic LPanic