Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for Example_wrapping (0.16 sec)

  1. src/log/slog/example_wrap_test.go

    	runtime.Callers(2, pcs[:]) // skip [Callers, Infof]
    	r := slog.NewRecord(time.Now(), slog.LevelInfo, fmt.Sprintf(format, args...), pcs[0])
    	_ = logger.Handler().Handle(context.Background(), r)
    }
    
    func Example_wrapping() {
    	replace := func(groups []string, a slog.Attr) slog.Attr {
    		// Remove time.
    		if a.Key == slog.TimeKey && len(groups) == 0 {
    			return slog.Attr{}
    		}
    		// Remove the directory from the source's filename.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 04 18:32:54 UTC 2023
    - 1.3K bytes
    - Viewed (0)
Back to top