Skip to content

Commit

Permalink
Use context logger when creating interface
Browse files Browse the repository at this point in the history
  • Loading branch information
tinyzimmer committed Jul 7, 2023
1 parent 9bfc78d commit 27ba78f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/net/system/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ limitations under the License.
package system

import (
"context"
"errors"
"fmt"
"net"
Expand All @@ -28,6 +27,7 @@ import (

"golang.org/x/exp/slog"

"github.com/webmeshproj/node/pkg/context"
"github.com/webmeshproj/node/pkg/net/system/link"
"github.com/webmeshproj/node/pkg/net/system/routes"
)
Expand Down Expand Up @@ -79,9 +79,8 @@ func New(ctx context.Context, opts *Options) (Interface, error) {
if opts.MTU == 0 {
opts.MTU = DefaultMTU
}
log := slog.Default().With(
slog.String("component", "wireguard"),
slog.String("facility", "device"))
log := context.LoggerFrom(ctx).With(slog.String("component", "wireguard"))
ctx = context.WithLogger(ctx, log)
iface := &sysInterface{
opts: opts,
}
Expand Down

0 comments on commit 27ba78f

Please sign in to comment.