Structured logging (#8673)
* Implementing structured logging * Changes to en.json to allow refactor to run. * Fixing global logger * Structured logger initalization. * Add caller. * Do some log redirection. * Auto refactor * Cleaning up l4g reference and removing dependancy. * Removing junk. * Copyright headers. * Fixing tests * Revert "Changes to en.json to allow refactor to run." This reverts commit fd8249e99bcad0231e6ea65cd77c32aae9a54026. * Fixing some auto refactor strangeness and typo. * Making keys more human readable.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2acbc77d78
Коммит
686c2fbab7
@@ -11,9 +11,8 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
l4g "github.com/alecthomas/log4go"
|
||||
|
||||
"github.com/mattermost/mattermost-server/einterfaces"
|
||||
"github.com/mattermost/mattermost-server/mlog"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/plugin"
|
||||
"github.com/mattermost/mattermost-server/plugin/pluginenv"
|
||||
@@ -169,8 +168,8 @@ func (me *TestHelper) CreateTeam() *model.Team {
|
||||
utils.DisableDebugLogForTest()
|
||||
var err *model.AppError
|
||||
if team, err = me.App.CreateTeam(team); err != nil {
|
||||
l4g.Error(err.Error())
|
||||
l4g.Close()
|
||||
mlog.Error(err.Error())
|
||||
|
||||
time.Sleep(time.Second)
|
||||
panic(err)
|
||||
}
|
||||
@@ -192,8 +191,8 @@ func (me *TestHelper) CreateUser() *model.User {
|
||||
utils.DisableDebugLogForTest()
|
||||
var err *model.AppError
|
||||
if user, err = me.App.CreateUser(user); err != nil {
|
||||
l4g.Error(err.Error())
|
||||
l4g.Close()
|
||||
mlog.Error(err.Error())
|
||||
|
||||
time.Sleep(time.Second)
|
||||
panic(err)
|
||||
}
|
||||
@@ -219,8 +218,8 @@ func (me *TestHelper) createChannel(team *model.Team, channelType string) *model
|
||||
utils.DisableDebugLogForTest()
|
||||
var err *model.AppError
|
||||
if channel, err = me.App.CreateChannel(channel, true); err != nil {
|
||||
l4g.Error(err.Error())
|
||||
l4g.Close()
|
||||
mlog.Error(err.Error())
|
||||
|
||||
time.Sleep(time.Second)
|
||||
panic(err)
|
||||
}
|
||||
@@ -233,8 +232,8 @@ func (me *TestHelper) CreateDmChannel(user *model.User) *model.Channel {
|
||||
var err *model.AppError
|
||||
var channel *model.Channel
|
||||
if channel, err = me.App.CreateDirectChannel(me.BasicUser.Id, user.Id); err != nil {
|
||||
l4g.Error(err.Error())
|
||||
l4g.Close()
|
||||
mlog.Error(err.Error())
|
||||
|
||||
time.Sleep(time.Second)
|
||||
panic(err)
|
||||
}
|
||||
@@ -255,8 +254,8 @@ func (me *TestHelper) CreatePost(channel *model.Channel) *model.Post {
|
||||
utils.DisableDebugLogForTest()
|
||||
var err *model.AppError
|
||||
if post, err = me.App.CreatePost(post, channel, false); err != nil {
|
||||
l4g.Error(err.Error())
|
||||
l4g.Close()
|
||||
mlog.Error(err.Error())
|
||||
|
||||
time.Sleep(time.Second)
|
||||
panic(err)
|
||||
}
|
||||
@@ -269,8 +268,8 @@ func (me *TestHelper) LinkUserToTeam(user *model.User, team *model.Team) {
|
||||
|
||||
err := me.App.JoinUserToTeam(team, user, "")
|
||||
if err != nil {
|
||||
l4g.Error(err.Error())
|
||||
l4g.Close()
|
||||
mlog.Error(err.Error())
|
||||
|
||||
time.Sleep(time.Second)
|
||||
panic(err)
|
||||
}
|
||||
@@ -283,8 +282,8 @@ func (me *TestHelper) AddUserToChannel(user *model.User, channel *model.Channel)
|
||||
|
||||
member, err := me.App.AddUserToChannel(user, channel)
|
||||
if err != nil {
|
||||
l4g.Error(err.Error())
|
||||
l4g.Close()
|
||||
mlog.Error(err.Error())
|
||||
|
||||
time.Sleep(time.Second)
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user