Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for KindTime (0.12 sec)

  1. src/log/slog/value.go

    type Value struct {
    	_ [0]func() // disallow ==
    	// num holds the value for Kinds Int64, Uint64, Float64, Bool and Duration,
    	// the string length for KindString, and nanoseconds since the epoch for KindTime.
    	num uint64
    	// If any is of type Kind, then the value is in num as described above.
    	// If any is of type *time.Location, then the Kind is Time and time.Time value
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:12:08 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  2. src/log/slog/json_handler_test.go

    				v := a.Value
    				if v.Kind() == KindTime {
    					return String(a.Key, v.Time().Format(rfc3339Millis))
    				}
    				if a.Key == "level" {
    					return Attr{"severity", a.Value}
    				}
    				return a
    			},
    		}},
    		{"time unix", HandlerOptions{
    			ReplaceAttr: func(_ []string, a Attr) Attr {
    				v := a.Value
    				if v.Kind() == KindTime {
    					return Int64(a.Key, v.Time().UnixNano())
    				}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jul 11 17:06:26 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  3. src/log/slog/internal/benchmarks/handlers.go

    	case slog.KindBool:
    		*buf = strconv.AppendBool(*buf, v.Bool())
    	case slog.KindDuration:
    		*buf = strconv.AppendInt(*buf, v.Duration().Nanoseconds(), 10)
    	case slog.KindTime:
    		h.appendTime(buf, v.Time())
    	case slog.KindAny:
    		a := v.Any()
    		switch a := a.(type) {
    		case error:
    			buf.WriteString(a.Error())
    		default:
    			fmt.Fprint(buf, a)
    		}
    	default:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 12 20:33:37 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  4. src/log/slog/text_handler.go

    	return h.commonHandler.handle(r)
    }
    
    func appendTextValue(s *handleState, v Value) error {
    	switch v.Kind() {
    	case KindString:
    		s.appendString(v.str())
    	case KindTime:
    		s.appendTime(v.time())
    	case KindAny:
    		if tm, ok := v.any.(encoding.TextMarshaler); ok {
    			data, err := tm.MarshalText()
    			if err != nil {
    				return err
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 23 22:56:07 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  5. src/log/slog/json_handler.go

    			return err
    		}
    	case KindBool:
    		*s.buf = strconv.AppendBool(*s.buf, v.Bool())
    	case KindDuration:
    		// Do what json.Marshal does.
    		*s.buf = strconv.AppendInt(*s.buf, int64(v.Duration()), 10)
    	case KindTime:
    		s.appendTime(v.Time())
    	case KindAny:
    		a := v.Any()
    		_, jm := a.(json.Marshaler)
    		if err, ok := a.(error); ok && !jm {
    			s.appendString(err.Error())
    		} else {
    			return appendJSONMarshal(s.buf, a)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 16:18:11 UTC 2023
    - 8.1K bytes
    - Viewed (0)
  6. api/go1.21.txt

    pkg log/slog, const KindLogValuer = 9 #56345
    pkg log/slog, const KindLogValuer Kind #56345
    pkg log/slog, const KindString = 5 #56345
    pkg log/slog, const KindString Kind #56345
    pkg log/slog, const KindTime = 6 #56345
    pkg log/slog, const KindTime Kind #56345
    pkg log/slog, const KindUint64 = 7 #56345
    pkg log/slog, const KindUint64 Kind #56345
    pkg log/slog, const LevelDebug = -4 #56345
    pkg log/slog, const LevelDebug 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)
  7. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"KindDuration", Const, 21},
    		{"KindFloat64", Const, 21},
    		{"KindGroup", Const, 21},
    		{"KindInt64", Const, 21},
    		{"KindLogValuer", Const, 21},
    		{"KindString", Const, 21},
    		{"KindTime", Const, 21},
    		{"KindUint64", Const, 21},
    		{"Level", Type, 21},
    		{"LevelDebug", Const, 21},
    		{"LevelError", Const, 21},
    		{"LevelInfo", Const, 21},
    		{"LevelKey", Const, 21},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
Back to top