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:
parent
d21c91379e
commit
f51ec53a89
@ -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...)
|
||||||
|
@ -9,6 +9,7 @@ const (
|
|||||||
LTrace Level = iota
|
LTrace Level = iota
|
||||||
LDebug
|
LDebug
|
||||||
LInfo
|
LInfo
|
||||||
|
LNotice
|
||||||
LWarn
|
LWarn
|
||||||
LError
|
LError
|
||||||
LPanic
|
LPanic
|
||||||
|
Loading…
x
Reference in New Issue
Block a user