summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/mattermost-server/v5/mlog/default.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2021-10-17 00:47:22 +0200
committerGitHub <noreply@github.com>2021-10-17 00:47:22 +0200
commit4dd8bae5c91fa4aef09d865d8fef1acd84f90925 (patch)
treeffad9b242daccaf8c86d1c1fbd59032302bd3be9 /vendor/github.com/mattermost/mattermost-server/v5/mlog/default.go
parent7ae45c42e712bd0e66c101f3f714c05aa1dc2104 (diff)
downloadmatterbridge-msglm-4dd8bae5c91fa4aef09d865d8fef1acd84f90925.tar.gz
matterbridge-msglm-4dd8bae5c91fa4aef09d865d8fef1acd84f90925.tar.bz2
matterbridge-msglm-4dd8bae5c91fa4aef09d865d8fef1acd84f90925.zip
Update dependencies (#1610)
* Update dependencies * Update module to go 1.17
Diffstat (limited to 'vendor/github.com/mattermost/mattermost-server/v5/mlog/default.go')
-rw-r--r--vendor/github.com/mattermost/mattermost-server/v5/mlog/default.go95
1 files changed, 0 insertions, 95 deletions
diff --git a/vendor/github.com/mattermost/mattermost-server/v5/mlog/default.go b/vendor/github.com/mattermost/mattermost-server/v5/mlog/default.go
deleted file mode 100644
index 1e409b19..00000000
--- a/vendor/github.com/mattermost/mattermost-server/v5/mlog/default.go
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
-// See LICENSE.txt for license information.
-
-package mlog
-
-import (
- "context"
- "encoding/json"
- "errors"
- "fmt"
- "os"
-
- "github.com/mattermost/logr"
-)
-
-// defaultLog manually encodes the log to STDERR, providing a basic, default logging implementation
-// before mlog is fully configured.
-func defaultLog(level, msg string, fields ...Field) {
- log := struct {
- Level string `json:"level"`
- Message string `json:"msg"`
- Fields []Field `json:"fields,omitempty"`
- }{
- level,
- msg,
- fields,
- }
-
- if b, err := json.Marshal(log); err != nil {
- fmt.Fprintf(os.Stderr, `{"level":"error","msg":"failed to encode log message"}%s`, "\n")
- } else {
- fmt.Fprintf(os.Stderr, "%s\n", b)
- }
-}
-
-func defaultDebugLog(msg string, fields ...Field) {
- defaultLog("debug", msg, fields...)
-}
-
-func defaultInfoLog(msg string, fields ...Field) {
- defaultLog("info", msg, fields...)
-}
-
-func defaultWarnLog(msg string, fields ...Field) {
- defaultLog("warn", msg, fields...)
-}
-
-func defaultErrorLog(msg string, fields ...Field) {
- defaultLog("error", msg, fields...)
-}
-
-func defaultCriticalLog(msg string, fields ...Field) {
- // We map critical to error in zap, so be consistent.
- defaultLog("error", msg, fields...)
-}
-
-func defaultCustomLog(lvl LogLevel, msg string, fields ...Field) {
- // custom log levels are only output once log targets are configured.
-}
-
-func defaultCustomMultiLog(lvl []LogLevel, msg string, fields ...Field) {
- // custom log levels are only output once log targets are configured.
-}
-
-func defaultFlush(ctx context.Context) error {
- return nil
-}
-
-func defaultAdvancedConfig(cfg LogTargetCfg) error {
- // mlog.ConfigAdvancedConfig should not be called until default
- // logger is replaced with mlog.Logger instance.
- return errors.New("cannot config advanced logging on default logger")
-}
-
-func defaultAdvancedShutdown(ctx context.Context) error {
- return nil
-}
-
-func defaultAddTarget(targets ...logr.Target) error {
- // mlog.AddTarget should not be called until default
- // logger is replaced with mlog.Logger instance.
- return errors.New("cannot AddTarget on default logger")
-}
-
-func defaultRemoveTargets(ctx context.Context, f func(TargetInfo) bool) error {
- // mlog.RemoveTargets should not be called until default
- // logger is replaced with mlog.Logger instance.
- return errors.New("cannot RemoveTargets on default logger")
-}
-
-func defaultEnableMetrics(collector logr.MetricsCollector) error {
- // mlog.EnableMetrics should not be called until default
- // logger is replaced with mlog.Logger instance.
- return errors.New("cannot EnableMetrics on default logger")
-}