Gitea serv, hooks, manager and the like should always display Fatals (#13032)
Gitea serv, hooks, manager and the like should always display Fatals (#13032)

The gitea cmd/serv.go setup function deletes the console logger to
prevent stdout interference with commands. However, the problem is that
it then calls setting.NewContext which may cause an exit with log.Fatal
- which will then not be shown.

Now, log.Fatal is so disastrous that the interference that logging
causes is wanted. However, we can avoid stdout interference by emitting
on stderr.

This PR forces the creation of a console logger on stderr listening on
Fatal for these commands. Most commands have a `--debug` option now that
will print more reasons too - however, defaulting to give the log for
Fatal seems reasonable.

Signed-off-by: Andrew Thornton <6a547fdd28db89120bdd70d4af1f9ba672ccd43a@cantab.net>
vdbt/gitea,sapk-fork/gitea,sapk-fork/gitea,vdbt/gitea,go-gitea/gitea,go-gitea/gitea,sapk-fork/gitea,cez81/gitea,cez81/gitea,cez81/gitea,sapk-fork/gitea,go-gitea/gitea