mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
fix: Use slog for devtunnel logging (#3248)
Ensures standardized logging for server.
This commit is contained in:
committed by
GitHub
parent
cef622d77c
commit
bb05b1f749
@ -79,7 +79,11 @@ func NewWithConfig(ctx context.Context, logger slog.Logger, cfg Config) (*Tunnel
|
||||
}
|
||||
wgEndpoint := netip.AddrPortFrom(wgAddr, cfg.Tunnel.WireguardPort)
|
||||
|
||||
dev := device.NewDevice(tun, conn.NewDefaultBind(), device.NewLogger(device.LogLevelError, "devtunnel "))
|
||||
dlog := &device.Logger{
|
||||
Verbosef: slog.Stdlib(ctx, logger, slog.LevelDebug).Printf,
|
||||
Errorf: slog.Stdlib(ctx, logger, slog.LevelError).Printf,
|
||||
}
|
||||
dev := device.NewDevice(tun, conn.NewDefaultBind(), dlog)
|
||||
err = dev.IpcSet(fmt.Sprintf(`private_key=%s
|
||||
public_key=%s
|
||||
endpoint=%s
|
||||
|
Reference in New Issue
Block a user