* model -> public/model * plugin -> public/plugin * public/model/utils -> public/utils * platform/shared/mlog -> public/shared/mlog * platform/shared/i18n -> public/shared/i18n * platform/shared/markdown -> public/shared/markdown * platform/services/timezones -> public/shared/timezones * channels/einterfaces -> einterfaces * expose public/ submodule * go mod tidy * .github: cache-dependency-path, setup-go-work * modules-tidy for public/ too * remove old gomodtidy
24 строки
607 B
Go
24 строки
607 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package mlog
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// GraphQLLogger is used to log panics that occur during query execution.
|
|
type GraphQLLogger struct {
|
|
logger *Logger
|
|
}
|
|
|
|
func NewGraphQLLogger(logger *Logger) *GraphQLLogger {
|
|
return &GraphQLLogger{logger: logger}
|
|
}
|
|
|
|
// LogPanic satisfies the graphql/log.Logger interface.
|
|
// It converts the panic into an error.
|
|
func (l *GraphQLLogger) LogPanic(_ context.Context, value any) {
|
|
l.logger.Error("Error while executing GraphQL query", Any("error", value))
|
|
}
|