I noticed that Mage (magefile.org) appears to set the default logger (i.e., log.Default()
’s return) to discard. This is its default behaviour; to change it you have to set Mage to “verbose” mode.
I was confused on this for a while because of this:
> go doc log.Fatalf
package log // import "log"
func Fatalf(format string, v ...any)
Fatalf is equivalent to Printf() followed by a call to os.Exit(1).
In my case that wasn’t true, which confused multiple folks on my team.
Should this documentation be updated, or am I missing something? I’m thinking:
Fatalf is like fmt.Printf() followed by a call to os.Exit(1). Unlike Printf, though, Fatalf’s output goes to the standard logger’s output, which may or may not be os.Stdout.