-
Notifications
You must be signed in to change notification settings - Fork 0
/
server_client_logger.go
58 lines (46 loc) · 1.38 KB
/
server_client_logger.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package websocket
import (
"github.com/rs/zerolog"
)
// LDebug -> 0
func (c *Client) LDebug() *zerolog.Event {
return c.Logger.Debug()
}
// LInfo -> 1
func (c *Client) LInfo() *zerolog.Event {
return c.Logger.Info()
}
// LInfoF -> when you need specifically to indicate in what function the logging is happening
func (c *Client) LInfoF(functionName string) *zerolog.Event {
return c.Logger.InfoF(functionName)
}
func (c *Client) LDebugF(functionName string) *zerolog.Event {
return c.Logger.DebugF(functionName)
}
// LWarn -> 2
func (c *Client) LWarn() *zerolog.Event {
return c.Logger.Warn()
}
// LWarnF -> when you need specifically to indicate in what function the logging is happening
func (c *Client) LWarnF(functionName string) *zerolog.Event {
return c.Logger.WarnF(functionName)
}
// LError -> 3
func (c *Client) LError() *zerolog.Event {
return c.Logger.Error()
}
// LErrorF -> when you need specifically to indicate in what function the logging is happening
func (c *Client) LErrorF(functionName string) *zerolog.Event {
return c.Logger.ErrorF(functionName)
}
// LFatal -> 4
func (c *Client) LFatal() *zerolog.Event {
return c.Logger.Fatal()
}
// LPanic -> 5
func (c *Client) LPanic() *zerolog.Event {
return c.Logger.Panic()
}
func (c *Client) LEvent(eventType string, eventName string, beforeMsg func(event *zerolog.Event)) {
c.Logger.InfoEvent(eventType, eventName, beforeMsg)
}