log: start using gopkg.in/clog.v1

This commit is contained in:
Unknwon
2017-02-09 19:29:59 -05:00
parent 8a19f8a63c
commit eb66060cd7
66 changed files with 198 additions and 1033 deletions

View File

@@ -5,6 +5,7 @@
package admin
import (
"encoding/json"
"fmt"
"runtime"
"strings"
@@ -232,7 +233,12 @@ func Config(ctx *context.Context) {
}
loggers := make([]*logger, len(setting.LogModes))
for i := range setting.LogModes {
loggers[i] = &logger{setting.LogModes[i], setting.LogConfigs[i]}
loggers[i] = &logger{
Mode: strings.Title(setting.LogModes[i]),
}
result, _ := json.Marshal(setting.LogConfigs[i])
loggers[i].Config = string(result)
}
ctx.Data["Loggers"] = loggers

View File

@@ -9,13 +9,13 @@ import (
"github.com/Unknwon/com"
"github.com/go-xorm/core"
log "gopkg.in/clog.v1"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/auth"
"github.com/gogits/gogs/modules/auth/ldap"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/context"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/setting"
)

View File

@@ -7,11 +7,11 @@ package admin
import (
"github.com/Unknwon/com"
"github.com/Unknwon/paginater"
log "gopkg.in/clog.v1"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/context"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/setting"
)

View File

@@ -5,10 +5,11 @@
package admin
import (
log "gopkg.in/clog.v1"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/context"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/setting"
"github.com/gogits/gogs/routers"
)

View File

@@ -8,12 +8,12 @@ import (
"strings"
"github.com/Unknwon/com"
log "gopkg.in/clog.v1"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/auth"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/context"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/mailer"
"github.com/gogits/gogs/modules/setting"
"github.com/gogits/gogs/routers"