@@ -111,3 +111,94 @@ func (lrms *logRotateMaxSize) String() string {
111
111
func (lrms * logRotateMaxSize ) Type () string {
112
112
return "uint64"
113
113
}
114
+
115
+ type PrefixedLogger struct {
116
+ prefix string
117
+ }
118
+
119
+ func NewPrefixedLogger (prefix string ) * PrefixedLogger {
120
+ return & PrefixedLogger {prefix : prefix + ": " }
121
+ }
122
+
123
+ func (pl * PrefixedLogger ) V (level glog.Level ) glog.Verbose {
124
+ return V (level )
125
+ }
126
+
127
+ func (pl * PrefixedLogger ) Flush () {
128
+ Flush ()
129
+ }
130
+
131
+ func (pl * PrefixedLogger ) Info (args ... any ) {
132
+ args = append ([]interface {}{pl .prefix }, args ... )
133
+ Info (args ... )
134
+ }
135
+
136
+ func (pl * PrefixedLogger ) Infof (format string , args ... any ) {
137
+ args = append ([]interface {}{pl .prefix }, args ... )
138
+ Infof ("%s" + format , args ... )
139
+ }
140
+
141
+ func (pl * PrefixedLogger ) InfoDepth (depth int , args ... any ) {
142
+ args = append ([]interface {}{pl .prefix }, args ... )
143
+ InfoDepth (depth , args ... )
144
+ }
145
+
146
+ func (pl * PrefixedLogger ) Warning (args ... any ) {
147
+ args = append ([]interface {}{pl .prefix }, args ... )
148
+ Warning (args ... )
149
+ }
150
+
151
+ func (pl * PrefixedLogger ) Warningf (format string , args ... any ) {
152
+ args = append ([]interface {}{pl .prefix }, args ... )
153
+ Warningf ("%s" + format , args ... )
154
+ }
155
+
156
+ func (pl * PrefixedLogger ) WarningDepth (depth int , args ... any ) {
157
+ args = append ([]interface {}{pl .prefix }, args ... )
158
+ WarningDepth (depth , args ... )
159
+ }
160
+
161
+ func (pl * PrefixedLogger ) Error (args ... any ) {
162
+ args = append ([]interface {}{pl .prefix }, args ... )
163
+ Error (args ... )
164
+ }
165
+
166
+ func (pl * PrefixedLogger ) Errorf (format string , args ... any ) {
167
+ args = append ([]interface {}{pl .prefix }, args ... )
168
+ Errorf ("%s" + format , args ... )
169
+ }
170
+
171
+ func (pl * PrefixedLogger ) ErrorDepth (depth int , args ... any ) {
172
+ args = append ([]interface {}{pl .prefix }, args ... )
173
+ ErrorDepth (depth , args ... )
174
+ }
175
+
176
+ func (pl * PrefixedLogger ) Exit (args ... any ) {
177
+ args = append ([]interface {}{pl .prefix }, args ... )
178
+ Exit (args ... )
179
+ }
180
+
181
+ func (pl * PrefixedLogger ) Exitf (format string , args ... any ) {
182
+ args = append ([]interface {}{pl .prefix }, args ... )
183
+ Exitf ("%s" + format , args ... )
184
+ }
185
+
186
+ func (pl * PrefixedLogger ) ExitDepth (depth int , args ... any ) {
187
+ args = append ([]interface {}{pl .prefix }, args ... )
188
+ ExitDepth (depth , args ... )
189
+ }
190
+
191
+ func (pl * PrefixedLogger ) Fatal (args ... any ) {
192
+ args = append ([]interface {}{pl .prefix }, args ... )
193
+ Fatal (args ... )
194
+ }
195
+
196
+ func (pl * PrefixedLogger ) Fatalf (format string , args ... any ) {
197
+ args = append ([]interface {}{pl .prefix }, args ... )
198
+ Fatalf ("%s" + format , args ... )
199
+ }
200
+
201
+ func (pl * PrefixedLogger ) FatalDepth (depth int , args ... any ) {
202
+ args = append ([]interface {}{pl .prefix }, args ... )
203
+ FatalDepth (depth , args ... )
204
+ }
0 commit comments