mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2026-02-03 14:13:26 +00:00
Include handler errors in the log file #173
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JustAnotherArchivist on GitHub.
I realised today that many messages only get logged to stderr, not to the log file. In particular, this includes all errors in the handlers, e.g. errors on reading from the storage (i.e. the
log.Printfcalls inhandlers.go). I'd like to suggest having those both on stderr and in the log file (if one is specified).@paolafrancesca commented on GitHub:
I will check @JustAnotherArchivist , thanks for reporting.
@stefanbenten commented on GitHub:
I would suggest to chose either stderr or log, but not both.
@paolafrancesca commented on GitHub:
We should only rely on the logger instantiated in the cmd package: https://github.com/dutchcoders/transfer.sh/blob/master/cmd/cmd.go#L294
This will either use stdout or the log file if set (
49c6d7ee4f/server/server.go (L160-L176))The calls to
log.Printfetc should be replaced bylogger.Printfetc