Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger = logrus.FieldLogger
Logger is an alias, so that our other code has less need to know about the actual logging library in use.
func Setup ¶
func Setup() Logger
Setup sets up logging.
Setup should be changed to add whatever remote logging you want; <https://github.com/sirupsen/logrus> lists a variety of supported hooks for remote logging, whether into corporate log services, cloud log services, chat services, email, error/exception aggregation services or whatever else.
You can also use a remote service as the `.Out` field, if it's configured to provide an io.Writer interface instead of being set as a hook.
Tune to taste in this file and it should just work.
If logging can't be set-up, please assume that this is fatal and abort; we don't run without an audit trail going where it is supposed to go. If a network setup fails initial setup when called and returns an error, then so be it: we're a finger service, not critical plumbing infrastructure which must come up so that other things can come up. Don't add complexity. (If it turns out that complexity is needed for one flaky setup, then and only then add it.)
Recommend a sleep before Fatal so that if we keep dying, we don't die in a fast loop and chew system resources.