* 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.
Этот коммит содержится в:
Christopher Speller
2018-04-27 12:49:45 -07:00
коммит произвёл GitHub
родитель 2acbc77d78
Коммит 686c2fbab7
205 изменённых файлов: 9480 добавлений и 2488 удалений

Просмотреть файл

@@ -14,8 +14,6 @@ import (
"strconv"
"strings"
"time"
l4g "github.com/alecthomas/log4go"
)
var UsedApiV3 *int32 = new(int32)
@@ -210,7 +208,7 @@ func getCookie(name string, resp *http.Response) *http.Cookie {
// Must is a convenience function used for testing.
func (c *Client) Must(result *Result, err *AppError) *Result {
if err != nil {
l4g.Close()
time.Sleep(time.Second)
panic(err)
}
@@ -221,7 +219,7 @@ func (c *Client) Must(result *Result, err *AppError) *Result {
// MustGeneric is a convenience function used for testing.
func (c *Client) MustGeneric(result interface{}, err *AppError) interface{} {
if err != nil {
l4g.Close()
time.Sleep(time.Second)
panic(err)
}

Просмотреть файл

@@ -585,9 +585,10 @@ func (s *SqlSettings) SetDefaults() {
type LogSettings struct {
EnableConsole bool
ConsoleLevel string
ConsoleJson *bool
EnableFile bool
FileLevel string
FileFormat string
FileJson *bool
FileLocation string
EnableWebhookDebugging bool
EnableDiagnostics *bool
@@ -597,6 +598,14 @@ func (s *LogSettings) SetDefaults() {
if s.EnableDiagnostics == nil {
s.EnableDiagnostics = NewBool(true)
}
if s.ConsoleJson == nil {
s.ConsoleJson = NewBool(true)
}
if s.FileJson == nil {
s.FileJson = NewBool(true)
}
}
type PasswordSettings struct {