Debian Codegraph @

stdlib/go1_21_log_slog.go

raw symbols SCIP
1 // Code generated by 'yaegi extract log/slog'. DO NOT EDIT.
2
3 //go:build go1.21 && !go1.22
4 // +build go1.21,!go1.22
5
6 package stdlib
7
8 import (
9 "context"
10 "go/constant"
11 "go/token"
12 "log/slog"
13 "reflect"
14 )
15
16 func init() {
17 Symbols["log/slog/slog"] = map[string]reflect.Value{
18 // function, constant and variable definitions
19 "Any": reflect.ValueOf(slog.Any),
20 "AnyValue": reflect.ValueOf(slog.AnyValue),
21 "Bool": reflect.ValueOf(slog.Bool),
22 "BoolValue": reflect.ValueOf(slog.BoolValue),
23 "Debug": reflect.ValueOf(slog.Debug),
24 "DebugContext": reflect.ValueOf(slog.DebugContext),
25 "Default": reflect.ValueOf(slog.Default),
26 "Duration": reflect.ValueOf(slog.Duration),
27 "DurationValue": reflect.ValueOf(slog.DurationValue),
28 "Error": reflect.ValueOf(slog.Error),
29 "ErrorContext": reflect.ValueOf(slog.ErrorContext),
30 "Float64": reflect.ValueOf(slog.Float64),
31 "Float64Value": reflect.ValueOf(slog.Float64Value),
32 "Group": reflect.ValueOf(slog.Group),
33 "GroupValue": reflect.ValueOf(slog.GroupValue),
34 "Info": reflect.ValueOf(slog.Info),
35 "InfoContext": reflect.ValueOf(slog.InfoContext),
36 "Int": reflect.ValueOf(slog.Int),
37 "Int64": reflect.ValueOf(slog.Int64),
38 "Int64Value": reflect.ValueOf(slog.Int64Value),
39 "IntValue": reflect.ValueOf(slog.IntValue),
40 "KindAny": reflect.ValueOf(slog.KindAny),
41 "KindBool": reflect.ValueOf(slog.KindBool),
42 "KindDuration": reflect.ValueOf(slog.KindDuration),
43 "KindFloat64": reflect.ValueOf(slog.KindFloat64),
44 "KindGroup": reflect.ValueOf(slog.KindGroup),
45 "KindInt64": reflect.ValueOf(slog.KindInt64),
46 "KindLogValuer": reflect.ValueOf(slog.KindLogValuer),
47 "KindString": reflect.ValueOf(slog.KindString),
48 "KindTime": reflect.ValueOf(slog.KindTime),
49 "KindUint64": reflect.ValueOf(slog.KindUint64),
50 "LevelDebug": reflect.ValueOf(slog.LevelDebug),
51 "LevelError": reflect.ValueOf(slog.LevelError),
52 "LevelInfo": reflect.ValueOf(slog.LevelInfo),
53 "LevelKey": reflect.ValueOf(constant.MakeFromLiteral("\"level\"", token.STRING, 0)),
54 "LevelWarn": reflect.ValueOf(slog.LevelWarn),
55 "Log": reflect.ValueOf(slog.Log),
56 "LogAttrs": reflect.ValueOf(slog.LogAttrs),
57 "MessageKey": reflect.ValueOf(constant.MakeFromLiteral("\"msg\"", token.STRING, 0)),
58 "New": reflect.ValueOf(slog.New),
59 "NewJSONHandler": reflect.ValueOf(slog.NewJSONHandler),
60 "NewLogLogger": reflect.ValueOf(slog.NewLogLogger),
61 "NewRecord": reflect.ValueOf(slog.NewRecord),
62 "NewTextHandler": reflect.ValueOf(slog.NewTextHandler),
63 "SetDefault": reflect.ValueOf(slog.SetDefault),
64 "SourceKey": reflect.ValueOf(constant.MakeFromLiteral("\"source\"", token.STRING, 0)),
65 "String": reflect.ValueOf(slog.String),
66 "StringValue": reflect.ValueOf(slog.StringValue),
67 "Time": reflect.ValueOf(slog.Time),
68 "TimeKey": reflect.ValueOf(constant.MakeFromLiteral("\"time\"", token.STRING, 0)),
69 "TimeValue": reflect.ValueOf(slog.TimeValue),
70 "Uint64": reflect.ValueOf(slog.Uint64),
71 "Uint64Value": reflect.ValueOf(slog.Uint64Value),
72 "Warn": reflect.ValueOf(slog.Warn),
73 "WarnContext": reflect.ValueOf(slog.WarnContext),
74 "With": reflect.ValueOf(slog.With),
75
76 // type definitions
77 "Attr": reflect.ValueOf((*slog.Attr)(nil)),
78 "Handler": reflect.ValueOf((*slog.Handler)(nil)),
79 "HandlerOptions": reflect.ValueOf((*slog.HandlerOptions)(nil)),
80 "JSONHandler": reflect.ValueOf((*slog.JSONHandler)(nil)),
81 "Kind": reflect.ValueOf((*slog.Kind)(nil)),
82 "Level": reflect.ValueOf((*slog.Level)(nil)),
83 "LevelVar": reflect.ValueOf((*slog.LevelVar)(nil)),
84 "Leveler": reflect.ValueOf((*slog.Leveler)(nil)),
85 "LogValuer": reflect.ValueOf((*slog.LogValuer)(nil)),
86 "Logger": reflect.ValueOf((*slog.Logger)(nil)),
87 "Record": reflect.ValueOf((*slog.Record)(nil)),
88 "Source": reflect.ValueOf((*slog.Source)(nil)),
89 "TextHandler": reflect.ValueOf((*slog.TextHandler)(nil)),
90 "Value": reflect.ValueOf((*slog.Value)(nil)),
91
92 // interface wrapper definitions
93 "_Handler": reflect.ValueOf((*_log_slog_Handler)(nil)),
94 "_Leveler": reflect.ValueOf((*_log_slog_Leveler)(nil)),
95 "_LogValuer": reflect.ValueOf((*_log_slog_LogValuer)(nil)),
96 }
97 }
98
99 // _log_slog_Handler is an interface wrapper for Handler type
100 type _log_slog_Handler struct {
101 IValue interface{}
102 WEnabled func(a0 context.Context, a1 slog.Level) bool
103 WHandle func(a0 context.Context, a1 slog.Record) error
104 WWithAttrs func(attrs []slog.Attr) slog.Handler
105 WWithGroup func(name string) slog.Handler
106 }
107
108 func (W _log_slog_Handler) Enabled(a0 context.Context, a1 slog.Level) bool { return W.WEnabled(a0, a1) }
109 func (W _log_slog_Handler) Handle(a0 context.Context, a1 slog.Record) error { return W.WHandle(a0, a1) }
110 func (W _log_slog_Handler) WithAttrs(attrs []slog.Attr) slog.Handler { return W.WWithAttrs(attrs) }
111 func (W _log_slog_Handler) WithGroup(name string) slog.Handler { return W.WWithGroup(name) }
112
113 // _log_slog_Leveler is an interface wrapper for Leveler type
114 type _log_slog_Leveler struct {
115 IValue interface{}
116 WLevel func() slog.Level
117 }
118
119 func (W _log_slog_Leveler) Level() slog.Level { return W.WLevel() }
120
121 // _log_slog_LogValuer is an interface wrapper for LogValuer type
122 type _log_slog_LogValuer struct {
123 IValue interface{}
124 WLogValue func() slog.Value
125 }
126
127 func (W _log_slog_LogValuer) LogValue() slog.Value { return W.WLogValue() }