mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-05 23:34:11 +02:00
optimize log
This commit is contained in:
1 parent
38776a0dd5
commit
460aa3eaa9
4 files changed
+77
-15
No files matched your search
+20
-10
@@ -44,6 +44,23 @@ func exeDir() (string, error) {
|
||||
return path.Dir(p), nil
|
||||
}
|
||||
|
||||
func newLogService() {
|
||||
log.NewLogger()
|
||||
}
|
||||
|
||||
func newMailService() {
|
||||
// Check mailer setting.
|
||||
if Cfg.MustBool("mailer", "ENABLED") {
|
||||
MailService = &Mailer{
|
||||
Name: Cfg.MustValue("mailer", "NAME", AppName),
|
||||
Host: Cfg.MustValue("mailer", "HOST", "127.0.0.1:25"),
|
||||
User: Cfg.MustValue("mailer", "USER", "example@example.com"),
|
||||
Passwd: Cfg.MustValue("mailer", "PASSWD", "******"),
|
||||
}
|
||||
log.Info("Mail Service Enabled")
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
workDir, err := exeDir()
|
||||
@@ -72,14 +89,7 @@ func init() {
|
||||
AppName = Cfg.MustValue("", "APP_NAME", "Gogs: Go Git Service")
|
||||
Domain = Cfg.MustValue("server", "DOMAIN")
|
||||
|
||||
// Check mailer setting.
|
||||
if Cfg.MustBool("mailer", "ENABLED") {
|
||||
MailService = &Mailer{
|
||||
Name: Cfg.MustValue("mailer", "NAME", AppName),
|
||||
Host: Cfg.MustValue("mailer", "HOST", "127.0.0.1:25"),
|
||||
User: Cfg.MustValue("mailer", "USER", "example@example.com"),
|
||||
Passwd: Cfg.MustValue("mailer", "PASSWD", "******"),
|
||||
}
|
||||
log.Info("Mail Service Enabled")
|
||||
}
|
||||
// Extensions.
|
||||
newLogService()
|
||||
newMailService()
|
||||
}
|
||||
Reference in new issue
Block a user