diff --git a/app/request/context.go b/app/request/context.go index df98cc28c4..c3d895fdc5 100644 --- a/app/request/context.go +++ b/app/request/context.go @@ -8,6 +8,7 @@ import ( "github.com/mattermost/mattermost-server/v6/model" "github.com/mattermost/mattermost-server/v6/shared/i18n" + "github.com/mattermost/mattermost-server/v6/shared/mlog" ) type Context struct { @@ -18,6 +19,8 @@ type Context struct { path string userAgent string acceptLanguage string + logger mlog.LoggerIFace + err *model.AppError context context.Context } @@ -97,3 +100,19 @@ func (c *Context) SetContext(ctx context.Context) { func (c *Context) GetT() i18n.TranslateFunc { return c.t } + +func (c *Context) SetLogger(logger mlog.LoggerIFace) { + c.logger = logger +} + +func (c *Context) Logger() mlog.LoggerIFace { + return c.logger +} + +func (c *Context) SetAppError(err *model.AppError) { + c.err = err +} + +func (c *Context) AppError() *model.AppError { + return c.err +}