summaryrefslogtreecommitdiffstats
path: root/cmd/serv.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-12-25 15:44:57 +0000
committerLunny Xiao <xiaolunwen@gmail.com>2019-12-25 23:44:57 +0800
commit3e166bd0550eceade275023616a02a8bf12d58c9 (patch)
tree7500cafa6a9b8ec65939919bc9c63a3bb50f2851 /cmd/serv.go
parent8b2f29c0d2e571b45f004646d3b5e6bac1c2c419 (diff)
downloadgitea-3e166bd0550eceade275023616a02a8bf12d58c9.tar.gz
gitea-3e166bd0550eceade275023616a02a8bf12d58c9.zip
Add debug option to serv to help debug problems (#9492)
* Add debug option to serv to help debug problems * fixup! Add debug option to serv to help debug problems
Diffstat (limited to 'cmd/serv.go')
-rw-r--r--cmd/serv.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/cmd/serv.go b/cmd/serv.go
index 1ac6b21e53..8ffe9b3a4f 100644
--- a/cmd/serv.go
+++ b/cmd/serv.go
@@ -41,12 +41,20 @@ var CmdServ = cli.Command{
cli.BoolFlag{
Name: "enable-pprof",
},
+ cli.BoolFlag{
+ Name: "debug",
+ },
},
}
-func setup(logPath string) {
- _ = log.DelLogger("console")
+func setup(logPath string, debug bool) {
+ if !debug {
+ _ = log.DelLogger("console")
+ }
setting.NewContext()
+ if debug {
+ setting.ProdMode = false
+ }
}
func parseCmd(cmd string) (string, string) {
@@ -80,7 +88,7 @@ func fail(userMessage, logMessage string, args ...interface{}) {
func runServ(c *cli.Context) error {
// FIXME: This needs to internationalised
- setup("serv.log")
+ setup("serv.log", c.Bool("debug"))
if setting.SSH.Disabled {
println("Gitea: SSH has been disabled")