@@ -190,6 +190,10 @@ type ConnectResult struct {
190
190
}
191
191
192
192
func (c * ConnectResult ) LogValue () slog.Value {
193
+ if c == nil {
194
+ return slog .StringValue ("nil" )
195
+ }
196
+
193
197
return slog .GroupValue (
194
198
slog .String ("status" , StatusName (c .Status )),
195
199
slog .Any ("transmissions" , logger .CompactValues (c .Transmissions )),
@@ -231,6 +235,10 @@ type CommandResult struct {
231
235
}
232
236
233
237
func (c * CommandResult ) LogValue () slog.Value {
238
+ if c == nil {
239
+ return slog .StringValue ("nil" )
240
+ }
241
+
234
242
return slog .GroupValue (
235
243
slog .String ("status" , StatusName (c .Status )),
236
244
slog .Any ("streams" , logger .CompactValues (c .Streams )),
@@ -263,6 +271,10 @@ type HistoryPosition struct {
263
271
}
264
272
265
273
func (hp * HistoryPosition ) LogValue () slog.Value {
274
+ if hp == nil {
275
+ return slog .StringValue ("nil" )
276
+ }
277
+
266
278
return slog .GroupValue (slog .String ("epoch" , hp .Epoch ), slog .Uint64 ("offset" , hp .Offset ))
267
279
}
268
280
@@ -276,6 +288,10 @@ type HistoryRequest struct {
276
288
}
277
289
278
290
func (hr * HistoryRequest ) LogValue () slog.Value {
291
+ if hr == nil {
292
+ return slog .StringValue ("nil" )
293
+ }
294
+
279
295
return slog .GroupValue (slog .Int64 ("since" , hr .Since ), slog .Any ("streams" , hr .Streams ))
280
296
}
281
297
@@ -288,6 +304,10 @@ type Message struct {
288
304
}
289
305
290
306
func (m * Message ) LogValue () slog.Value {
307
+ if m == nil {
308
+ return slog .StringValue ("nil" )
309
+ }
310
+
291
311
return slog .GroupValue (
292
312
slog .String ("command" , m .Command ),
293
313
slog .String ("identifier" , m .Identifier ),
@@ -307,6 +327,10 @@ type StreamMessageMetadata struct {
307
327
}
308
328
309
329
func (smm * StreamMessageMetadata ) LogValue () slog.Value {
330
+ if smm == nil {
331
+ return slog .StringValue ("nil" )
332
+ }
333
+
310
334
return slog .GroupValue (slog .String ("exclude_socket" , smm .ExcludeSocket ))
311
335
}
312
336
@@ -374,6 +398,10 @@ type RemoteCommandMessage struct {
374
398
}
375
399
376
400
func (m * RemoteCommandMessage ) LogValue () slog.Value {
401
+ if m == nil {
402
+ return slog .StringValue ("nil" )
403
+ }
404
+
377
405
return slog .GroupValue (slog .String ("command" , m .Command ), slog .Any ("payload" , m .Payload ))
378
406
}
379
407
@@ -394,6 +422,10 @@ type RemoteDisconnectMessage struct {
394
422
}
395
423
396
424
func (m * RemoteDisconnectMessage ) LogValue () slog.Value {
425
+ if m == nil {
426
+ return slog .StringValue ("nil" )
427
+ }
428
+
397
429
return slog .GroupValue (slog .String ("ids" , m .Identifier ), slog .Bool ("reconnect" , m .Reconnect ))
398
430
}
399
431
@@ -446,6 +478,10 @@ type Reply struct {
446
478
}
447
479
448
480
func (r * Reply ) LogValue () slog.Value {
481
+ if r == nil {
482
+ return slog .StringValue ("nil" )
483
+ }
484
+
449
485
attrs := []slog.Attr {}
450
486
451
487
if r .Type != "" {
0 commit comments