Browse Source

pkg/setting: support Discord logger

Unknwon 7 years ago
parent
commit
9127001f11
5 changed files with 18 additions and 2 deletions
  1. 8 0
      conf/app.ini
  2. 1 1
      gogs.go
  3. 0 0
      pkg/bindata/bindata.go
  4. 8 0
      pkg/setting/setting.go
  5. 1 1
      templates/.VERSION

+ 8 - 0
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

+ 1 - 1
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

File diff suppressed because it is too large
+ 0 - 0
pkg/bindata/bindata.go


+ 8 - 0
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])

+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.11.46.0418
+0.11.47.0425

Some files were not shown because too many files changed in this diff