Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 1,192 for slog (0.07 sec)

  1. src/log/slog/internal/benchmarks/benchmarks_test.go

    							slog.Any("error", testError),
    							slog.String("string", testString),
    							slog.Int("status", testInt),
    							slog.Duration("duration", testDuration),
    							slog.Time("time", testTime),
    							slog.Any("error", testError),
    							slog.String("string", testString),
    							slog.Int("status", testInt),
    							slog.Duration("duration", testDuration),
    							slog.Time("time", testTime),
    							slog.Any("error", testError),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 04 18:32:54 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  2. src/log/slog/internal/slogtest/slogtest.go

    // Package slogtest contains support functions for testing slog.
    package slogtest
    
    import "log/slog"
    
    // RemoveTime removes the top-level time attribute.
    // It is intended to be used as a ReplaceAttr function,
    // to make example output deterministic.
    func RemoveTime(groups []string, a slog.Attr) slog.Attr {
    	if a.Key == slog.TimeKey && len(groups) == 0 {
    		return slog.Attr{}
    	}
    	return a
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 12 20:33:11 UTC 2023
    - 553 bytes
    - Viewed (0)
  3. src/testing/slogtest/slogtest.go

    			l.Info("msg", "a", "b", slog.Group("G", slog.String("c", "d")), "e", "f")
    		},
    		checks: []check{
    			hasAttr("a", "b"),
    			inGroup("G", hasAttr("c", "d")),
    			hasAttr("e", "f"),
    		},
    	},
    	{
    		name:        "empty-group",
    		explanation: withSource("a Handler should ignore an empty group"),
    		f: func(l *slog.Logger) {
    			l.Info("msg", "a", "b", slog.Group("G"), "e", "f")
    		},
    		checks: []check{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 08 17:55:47 UTC 2023
    - 9.8K bytes
    - Viewed (0)
  4. api/go1.21.txt

    pkg log/slog, const LevelDebug = -4 #56345
    pkg log/slog, const LevelDebug Level #56345
    pkg log/slog, const LevelError = 8 #56345
    pkg log/slog, const LevelError Level #56345
    pkg log/slog, const LevelInfo = 0 #56345
    pkg log/slog, const LevelInfo Level #56345
    pkg log/slog, const LevelKey ideal-string #56345
    pkg log/slog, const LevelKey = "level" #56345
    pkg log/slog, const LevelWarn = 4 #56345
    pkg log/slog, const LevelWarn Level #56345
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 09:39:17 UTC 2023
    - 25.6K bytes
    - Viewed (0)
  5. src/log/slog/example_custom_levels_test.go

    	const (
    		LevelTrace     = slog.Level(-8)
    		LevelDebug     = slog.LevelDebug
    		LevelInfo      = slog.LevelInfo
    		LevelNotice    = slog.Level(2)
    		LevelWarning   = slog.LevelWarn
    		LevelError     = slog.LevelError
    		LevelEmergency = slog.Level(12)
    	)
    
    	th := slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{
    		// Set a custom level to show all log output. The default value is
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jul 11 17:06:26 UTC 2023
    - 3K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/slog/doc.go

    // license that can be found in the LICENSE file.
    
    // Package slog defines an Analyzer that checks for
    // mismatched key-value pairs in log/slog calls.
    //
    // # Analyzer slog
    //
    // slog: check for invalid structured logging calls
    //
    // The slog checker looks for calls to functions from the log/slog
    // package that take alternating key-value pairs. It reports calls
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 22 18:11:19 UTC 2023
    - 830 bytes
    - Viewed (0)
  7. src/log/slog/example_logvaluer_secret_test.go

    // license that can be found in the LICENSE file.
    
    package slog_test
    
    import (
    	"log/slog"
    	"log/slog/internal/slogtest"
    	"os"
    )
    
    // A token is a secret value that grants permissions.
    type Token string
    
    // LogValue implements slog.LogValuer.
    // It avoids revealing the token.
    func (Token) LogValue() slog.Value {
    	return slog.StringValue("REDACTED_TOKEN")
    }
    
    // This example demonstrates a Value that replaces itself
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 04 18:32:54 UTC 2023
    - 906 bytes
    - Viewed (0)
  8. src/log/slog/example_logvaluer_group_test.go

    package slog_test
    
    import "log/slog"
    
    type Name struct {
    	First, Last string
    }
    
    // LogValue implements slog.LogValuer.
    // It returns a group containing the fields of
    // the Name, so that they appear together in the log output.
    func (n Name) LogValue() slog.Value {
    	return slog.GroupValue(
    		slog.String("first", n.First),
    		slog.String("last", n.Last))
    }
    
    func ExampleLogValuer_group() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 21 20:55:33 UTC 2023
    - 825 bytes
    - Viewed (0)
  9. src/log/slog/slogtest_test.go

    package slog_test
    
    import (
    	"bytes"
    	"encoding/json"
    	"fmt"
    	"io"
    	"log/slog"
    	"strings"
    	"testing"
    	"testing/slogtest"
    )
    
    func TestSlogtest(t *testing.T) {
    	for _, test := range []struct {
    		name  string
    		new   func(io.Writer) slog.Handler
    		parse func([]byte) (map[string]any, error)
    	}{
    		{"JSON", func(w io.Writer) slog.Handler { return slog.NewJSONHandler(w, nil) }, parseJSON},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 10 12:50:22 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  10. src/log/internal/internal.go

    // license that can be found in the LICENSE file.
    
    // Package internal contains definitions used by both log and log/slog.
    package internal
    
    // DefaultOutput holds a function which calls the default log.Logger's
    // output function.
    // It allows slog.defaultHandler to call into an unexported function of
    // the log package.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 12 18:33:50 UTC 2023
    - 487 bytes
    - Viewed (0)
Back to top