-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstancesugars.go
110 lines (89 loc) · 5.14 KB
/
instancesugars.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
package slog
// region --- INFO Level Sugars ---
// Note logs out a message in INFO level and with Operation NOTE. Returns an instance of operation NOTE
func (i *slogInstance) Note(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(NOTE).Info(str, v...)
}
// Await logs out a message in INFO level and with Operation AWAIT. Returns an instance of operation AWAIT
func (i *slogInstance) Await(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(AWAIT).Info(str, v...)
}
// Done logs out a message in INFO level and with Operation DONE. Returns an instance of operation DONE
func (i *slogInstance) Done(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(DONE).Info(str, v...)
}
// Success logs out a message in INFO level and with Operation DONE. Returns an instance of operation DONE
func (i *slogInstance) Success(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(DONE).Info(str, v...)
}
// IO logs out a message in INFO level and with Operation IO. Returns an instance of operation IO
func (i *slogInstance) IO(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(IO).Info(str, v...)
}
// endregion
// region --- WARN Level Sugars ---
// Note logs out a message in WARN level and with Operation NOTE. Returns an instance of operation NOTE
func (i *slogInstance) WarnNote(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(NOTE).Warn(str, v...)
}
// Await logs out a message in WARN level and with Operation AWAIT. Returns an instance of operation AWAIT
func (i *slogInstance) WarnAwait(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(AWAIT).Warn(str, v...)
}
// Done logs out a message in WARN level and with Operation DONE. Returns an instance of operation DONE
func (i *slogInstance) WarnDone(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(DONE).Warn(str, v...)
}
// Success logs out a message in WARN level and with Operation DONE. Returns an instance of operation DONE
func (i *slogInstance) WarnSuccess(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(DONE).Warn(str, v...)
}
// IO logs out a message in WARN level and with Operation IO. Returns an instance of operation IO
func (i *slogInstance) WarnIO(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(IO).Warn(str, v...)
}
// endregion
// region --- ERROR Level Sugars ---
// Note logs out a message in ERROR level and with Operation NOTE. Returns an instance of operation NOTE
func (i *slogInstance) ErrorNote(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(NOTE).Error(str, v...)
}
// Await logs out a message in ERROR level and with Operation AWAIT. Returns an instance of operation AWAIT
func (i *slogInstance) ErrorAwait(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(AWAIT).Error(str, v...)
}
// Done logs out a message in ERROR level and with Operation DONE. Returns an instance of operation DONE
func (i *slogInstance) ErrorDone(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(DONE).Error(str, v...)
}
// Success logs out a message in ERROR level and with Operation DONE. Returns an instance of operation DONE
func (i *slogInstance) ErrorSuccess(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(DONE).Error(str, v...)
}
// IO logs out a message in ERROR level and with Operation IO. Returns an instance of operation IO
func (i *slogInstance) ErrorIO(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(IO).Error(str, v...)
}
// endregion
// region --- DEBUG Level Sugars ---
// Note logs out a message in DEBUG level and with Operation NOTE. Returns an instance of operation NOTE
func (i *slogInstance) DebugNote(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(NOTE).Debug(str, v...)
}
// Await logs out a message in DEBUG level and with Operation AWAIT. Returns an instance of operation AWAIT
func (i *slogInstance) DebugAwait(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(AWAIT).Debug(str, v...)
}
// Done logs out a message in DEBUG level and with Operation DONE. Returns an instance of operation DONE
func (i *slogInstance) DebugDone(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(DONE).Debug(str, v...)
}
// Success logs out a message in DEBUG level and with Operation DONE. Returns an instance of operation DONE
func (i *slogInstance) DebugSuccess(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(DONE).Debug(str, v...)
}
// IO logs out a message in DEBUG level and with Operation IO. Returns an instance of operation IO
func (i *slogInstance) DebugIO(str interface{}, v ...interface{}) Instance {
return i.clone().incStackOffset().Operation(IO).Debug(str, v...)
}
// endregion