Browse Source

pkg/setting: support Discord logger

pull/5209/head
Unknwon 7 years ago
parent
commit
9127001f11
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 8
      conf/app.ini
  2. 2
      gogs.go
  3. 4
      pkg/bindata/bindata.go
  4. 8
      pkg/setting/setting.go
  5. 2
      templates/.VERSION

8
conf/app.ini

@ -353,6 +353,14 @@ LEVEL =
; Webhook URL
URL =
[log.discord]
; leave empty to inherit
LEVEL =
; Webhook URL
URL =
; Username displayed in webhook
USERNAME = %(APP_NAME)s
[log.xorm]
; Enable file rotation
ROTATE = true

2
gogs.go

@ -16,7 +16,7 @@ import (
"github.com/gogits/gogs/pkg/setting"
)
const APP_VER = "0.11.46.0418"
const APP_VER = "0.11.47.0425"
func init() {
setting.AppVer = APP_VER

4
pkg/bindata/bindata.go

File diff suppressed because one or more lines are too long

8
pkg/setting/setting.go

@ -777,6 +777,14 @@ func newLogService() {
BufferSize: Cfg.Section("log").Key("BUFFER_LEN").MustInt64(100),
URL: sec.Key("URL").String(),
}
case log.DISCORD:
LogConfigs[i] = log.DiscordConfig{
Level: level,
BufferSize: Cfg.Section("log").Key("BUFFER_LEN").MustInt64(100),
URL: sec.Key("URL").String(),
Username: sec.Key("USERNAME").String(),
}
}
log.New(log.MODE(mode), LogConfigs[i])

2
templates/.VERSION

@ -1 +1 @@
0.11.46.0418
0.11.47.0425
Loading…
Cancel
Save