Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for LogAttrs (0.06 sec)

  1. src/log/slog/doc.go

    without an allocation.
    
    For the most efficient log output, use [Logger.LogAttrs].
    It is similar to [Logger.Log] but accepts only Attrs, not alternating
    keys and values; this allows it, too, to avoid allocation.
    
    The call
    
    	logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3))
    
    is the most efficient way to achieve the same output as
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 15 14:35:48 UTC 2024
    - 12.3K bytes
    - Viewed (0)
Back to top