diff options
author | zeripath <art27@cantab.net> | 2022-08-19 02:27:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-18 21:27:27 -0400 |
commit | 3aa5749d538d058c26fe79043612ff8191d1a247 (patch) | |
tree | 427f1bdb792363a204b379191f6af7da42b2c118 /modules | |
parent | 68f3aaee809eb1c6a99045a608a10d3707ce2557 (diff) | |
download | gitea-3aa5749d538d058c26fe79043612ff8191d1a247.tar.gz gitea-3aa5749d538d058c26fe79043612ff8191d1a247.zip |
Disable doctor logging on panic (#20847)
* Disable doctor logging on panic
If permissions are incorrect for writing to the doctor log simply disable the log file
instead of panicing.
Related #20570
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update cmd/doctor.go
* Update cmd/doctor.go
Co-authored-by: delvh <dev.lh@web.de>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/log/multichannel.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/log/multichannel.go b/modules/log/multichannel.go index 273df81df1..519abf663d 100644 --- a/modules/log/multichannel.go +++ b/modules/log/multichannel.go @@ -33,7 +33,7 @@ func newLogger(name string, buffer int64) *MultiChannelledLogger { func (l *MultiChannelledLogger) SetLogger(name, provider, config string) error { eventLogger, err := NewChannelledLog(l.ctx, name, provider, config, l.bufferLength) if err != nil { - return fmt.Errorf("Failed to create sublogger (%s): %v", name, err) + return fmt.Errorf("failed to create sublogger (%s): %w", name, err) } l.MultiChannelledLog.DelLogger(name) @@ -41,9 +41,9 @@ func (l *MultiChannelledLogger) SetLogger(name, provider, config string) error { err = l.MultiChannelledLog.AddLogger(eventLogger) if err != nil { if IsErrDuplicateName(err) { - return fmt.Errorf("Duplicate named sublogger %s %v", name, l.MultiChannelledLog.GetEventLoggerNames()) + return fmt.Errorf("%w other names: %v", err, l.MultiChannelledLog.GetEventLoggerNames()) } - return fmt.Errorf("Failed to add sublogger (%s): %v", name, err) + return fmt.Errorf("failed to add sublogger (%s): %w", name, err) } return nil |