Files
moxa/stdlib/go1_21_log_slog.go
Marc Vertes 0a5b16cad6 feat: support go1.22
* feat: support go1.22

* Temporary fix for consistency tests due to language change in for loops

* review: clean old files

---------

Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2024-03-05 17:56:04 +01:00

140 lines
5.5 KiB
Go

// Code generated by 'yaegi extract log/slog'. DO NOT EDIT.
//go:build go1.21 && !go1.22
// +build go1.21,!go1.22
package stdlib
import (
"context"
"go/constant"
"go/token"
"log/slog"
"reflect"
)
func init() {
Symbols["log/slog/slog"] = map[string]reflect.Value{
// function, constant and variable definitions
"Any": reflect.ValueOf(slog.Any),
"AnyValue": reflect.ValueOf(slog.AnyValue),
"Bool": reflect.ValueOf(slog.Bool),
"BoolValue": reflect.ValueOf(slog.BoolValue),
"Debug": reflect.ValueOf(slog.Debug),
"DebugContext": reflect.ValueOf(slog.DebugContext),
"Default": reflect.ValueOf(slog.Default),
"Duration": reflect.ValueOf(slog.Duration),
"DurationValue": reflect.ValueOf(slog.DurationValue),
"Error": reflect.ValueOf(slog.Error),
"ErrorContext": reflect.ValueOf(slog.ErrorContext),
"Float64": reflect.ValueOf(slog.Float64),
"Float64Value": reflect.ValueOf(slog.Float64Value),
"Group": reflect.ValueOf(slog.Group),
"GroupValue": reflect.ValueOf(slog.GroupValue),
"Info": reflect.ValueOf(slog.Info),
"InfoContext": reflect.ValueOf(slog.InfoContext),
"Int": reflect.ValueOf(slog.Int),
"Int64": reflect.ValueOf(slog.Int64),
"Int64Value": reflect.ValueOf(slog.Int64Value),
"IntValue": reflect.ValueOf(slog.IntValue),
"KindAny": reflect.ValueOf(slog.KindAny),
"KindBool": reflect.ValueOf(slog.KindBool),
"KindDuration": reflect.ValueOf(slog.KindDuration),
"KindFloat64": reflect.ValueOf(slog.KindFloat64),
"KindGroup": reflect.ValueOf(slog.KindGroup),
"KindInt64": reflect.ValueOf(slog.KindInt64),
"KindLogValuer": reflect.ValueOf(slog.KindLogValuer),
"KindString": reflect.ValueOf(slog.KindString),
"KindTime": reflect.ValueOf(slog.KindTime),
"KindUint64": reflect.ValueOf(slog.KindUint64),
"LevelDebug": reflect.ValueOf(slog.LevelDebug),
"LevelError": reflect.ValueOf(slog.LevelError),
"LevelInfo": reflect.ValueOf(slog.LevelInfo),
"LevelKey": reflect.ValueOf(constant.MakeFromLiteral("\"level\"", token.STRING, 0)),
"LevelWarn": reflect.ValueOf(slog.LevelWarn),
"Log": reflect.ValueOf(slog.Log),
"LogAttrs": reflect.ValueOf(slog.LogAttrs),
"MessageKey": reflect.ValueOf(constant.MakeFromLiteral("\"msg\"", token.STRING, 0)),
"New": reflect.ValueOf(slog.New),
"NewJSONHandler": reflect.ValueOf(slog.NewJSONHandler),
"NewLogLogger": reflect.ValueOf(slog.NewLogLogger),
"NewRecord": reflect.ValueOf(slog.NewRecord),
"NewTextHandler": reflect.ValueOf(slog.NewTextHandler),
"SetDefault": reflect.ValueOf(slog.SetDefault),
"SourceKey": reflect.ValueOf(constant.MakeFromLiteral("\"source\"", token.STRING, 0)),
"String": reflect.ValueOf(slog.String),
"StringValue": reflect.ValueOf(slog.StringValue),
"Time": reflect.ValueOf(slog.Time),
"TimeKey": reflect.ValueOf(constant.MakeFromLiteral("\"time\"", token.STRING, 0)),
"TimeValue": reflect.ValueOf(slog.TimeValue),
"Uint64": reflect.ValueOf(slog.Uint64),
"Uint64Value": reflect.ValueOf(slog.Uint64Value),
"Warn": reflect.ValueOf(slog.Warn),
"WarnContext": reflect.ValueOf(slog.WarnContext),
"With": reflect.ValueOf(slog.With),
// type definitions
"Attr": reflect.ValueOf((*slog.Attr)(nil)),
"Handler": reflect.ValueOf((*slog.Handler)(nil)),
"HandlerOptions": reflect.ValueOf((*slog.HandlerOptions)(nil)),
"JSONHandler": reflect.ValueOf((*slog.JSONHandler)(nil)),
"Kind": reflect.ValueOf((*slog.Kind)(nil)),
"Level": reflect.ValueOf((*slog.Level)(nil)),
"LevelVar": reflect.ValueOf((*slog.LevelVar)(nil)),
"Leveler": reflect.ValueOf((*slog.Leveler)(nil)),
"LogValuer": reflect.ValueOf((*slog.LogValuer)(nil)),
"Logger": reflect.ValueOf((*slog.Logger)(nil)),
"Record": reflect.ValueOf((*slog.Record)(nil)),
"Source": reflect.ValueOf((*slog.Source)(nil)),
"TextHandler": reflect.ValueOf((*slog.TextHandler)(nil)),
"Value": reflect.ValueOf((*slog.Value)(nil)),
// interface wrapper definitions
"_Handler": reflect.ValueOf((*_log_slog_Handler)(nil)),
"_Leveler": reflect.ValueOf((*_log_slog_Leveler)(nil)),
"_LogValuer": reflect.ValueOf((*_log_slog_LogValuer)(nil)),
}
}
// _log_slog_Handler is an interface wrapper for Handler type
type _log_slog_Handler struct {
IValue interface{}
WEnabled func(a0 context.Context, a1 slog.Level) bool
WHandle func(a0 context.Context, a1 slog.Record) error
WWithAttrs func(attrs []slog.Attr) slog.Handler
WWithGroup func(name string) slog.Handler
}
func (W _log_slog_Handler) Enabled(a0 context.Context, a1 slog.Level) bool {
return W.WEnabled(a0, a1)
}
func (W _log_slog_Handler) Handle(a0 context.Context, a1 slog.Record) error {
return W.WHandle(a0, a1)
}
func (W _log_slog_Handler) WithAttrs(attrs []slog.Attr) slog.Handler {
return W.WWithAttrs(attrs)
}
func (W _log_slog_Handler) WithGroup(name string) slog.Handler {
return W.WWithGroup(name)
}
// _log_slog_Leveler is an interface wrapper for Leveler type
type _log_slog_Leveler struct {
IValue interface{}
WLevel func() slog.Level
}
func (W _log_slog_Leveler) Level() slog.Level {
return W.WLevel()
}
// _log_slog_LogValuer is an interface wrapper for LogValuer type
type _log_slog_LogValuer struct {
IValue interface{}
WLogValue func() slog.Value
}
func (W _log_slog_LogValuer) LogValue() slog.Value {
return W.WLogValue()
}