Port of github.com/juju/zaputil/zapctx for github.com/sirupsen/logrus
package main
import (
"context"
"github.com/sirupsen/logrus"
"github.com/0x2b3bfa0/logrusctx"
)
func main() {
ctx := context.Background()
logger := logrus.WithField("key", "value")
ctx = logrusctx.WithLogger(ctx, logger)
worker(ctx)
}
func worker(ctx context.Context) {
logrusctx.Info(ctx, "test")
}