mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Document variable names for request.CTX and mlog.Logger (#26029)
This commit is contained in:
parent
223c9c7426
commit
929ab6b289
@ -28,6 +28,7 @@ const (
|
|||||||
DefaultMetricsUpdateFreqMillis = 15000
|
DefaultMetricsUpdateFreqMillis = 15000
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// LoggerIFace should be abbreviated as `logger`.
|
||||||
type LoggerIFace interface {
|
type LoggerIFace interface {
|
||||||
IsLevelEnabled(Level) bool
|
IsLevelEnabled(Level) bool
|
||||||
Trace(string, ...Field)
|
Trace(string, ...Field)
|
||||||
@ -169,6 +170,8 @@ func Map[M ~map[K]V, K comparable, V any](key string, val M) Field {
|
|||||||
// so that there are no allocations on the heap each interface method invocation. Normally not
|
// so that there are no allocations on the heap each interface method invocation. Normally not
|
||||||
// something to be concerned about, but logging calls for disabled levels should have as little CPU
|
// something to be concerned about, but logging calls for disabled levels should have as little CPU
|
||||||
// and memory impact as possible. Most of these wrapper calls will be inlined as well.
|
// and memory impact as possible. Most of these wrapper calls will be inlined as well.
|
||||||
|
//
|
||||||
|
// Logger should be abbreviated as `logger`.
|
||||||
type Logger struct {
|
type Logger struct {
|
||||||
log *logr.Logger
|
log *logr.Logger
|
||||||
lockConfig *int32
|
lockConfig *int32
|
||||||
|
@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/mattermost/mattermost/server/public/shared/mlog"
|
"github.com/mattermost/mattermost/server/public/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Context should be abbreviated as `rctx`.
|
||||||
type Context struct {
|
type Context struct {
|
||||||
t i18n.TranslateFunc
|
t i18n.TranslateFunc
|
||||||
session model.Session
|
session model.Session
|
||||||
@ -148,6 +149,7 @@ func (c *Context) With(f func(ctx CTX) CTX) CTX {
|
|||||||
return f(c)
|
return f(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CTX should be abbreviated as `rctx`.
|
||||||
type CTX interface {
|
type CTX interface {
|
||||||
T(string, ...interface{}) string
|
T(string, ...interface{}) string
|
||||||
GetT() i18n.TranslateFunc
|
GetT() i18n.TranslateFunc
|
||||||
|
Loading…
Reference in New Issue
Block a user