Format patterns
Control readable console and file output
Format patterns control how human-readable records are printed.
err := logy.LoadConfig(&logy.Config{
Console: &logy.ConsoleConfig{
Enabled: true,
Color: true,
Format: "%d{2006-01-02 15:04:05.000} %p %c : %s%e%n",
},
})
if err != nil {
panic(err)
}The pattern decides which parts of a record appear in the output:
%d{...}prints the timestamp using a Go time layout.%pprints the level.%cprints the logger name.%sprints the rendered message.%eprints error details when an error is attached.%nprints a newline.
Use pattern output for local development, command line tools, and destinations where people read logs directly.
