all repos — x @ 434bbe77faa4b87eace015c800bf3cfdfe39042a

Experiments and stuff

wrap log errors with fault

Alan Pearce
commit

434bbe77faa4b87eace015c800bf3cfdfe39042a

parent

3d0242f0d90d494f52bd8a5f32df35dd0fcfed2d

1 file changed, 3 insertions(+), 1 deletion(-)

changed files
M log/log.golog/log.go
@@ -3,6 +3,8 @@
import ( "os" + "github.com/Southclaws/fault" + "github.com/Southclaws/fault/fmsg" zaplogfmt "github.com/sykesm/zap-logfmt" prettyconsole "github.com/thessem/zap-prettyconsole" "go.uber.org/zap"
@@ -55,7 +57,7 @@ func getLevelFromEnv() (zapcore.Level, error) {
if str, found := os.LookupEnv("LOG_LEVEL"); found { l, err := zapcore.ParseLevel(str) - return l, err + return l, fault.Wrap(err, fmsg.With("failed to parse log level")) } return zap.InfoLevel, nil