mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-09-04 13:36:35 +02:00
all: eliminate usage of global ProxyLogger
So setting up logging for ctrld binary and ctrld packages could be done more easily, decouple the required setup for interactive vs daemon running. This is the first step toward replacing rs/zerolog libary with a different logging library.
This commit is contained in:
@@ -22,8 +22,8 @@ func dnsFns() []dnsFn {
|
||||
return []dnsFn{dnsFromResolvConf, getDNSFromScutil, getAllDHCPNameservers}
|
||||
}
|
||||
|
||||
func getDNSFromScutil() []string {
|
||||
logger := *ProxyLogger.Load()
|
||||
func getDNSFromScutil(ctx context.Context) []string {
|
||||
logger := LoggerFromCtx(ctx)
|
||||
|
||||
const (
|
||||
maxRetries = 10
|
||||
@@ -109,8 +109,8 @@ func getDHCPNameservers(iface string) ([]string, error) {
|
||||
return nameservers, nil
|
||||
}
|
||||
|
||||
func getAllDHCPNameservers() []string {
|
||||
logger := *ProxyLogger.Load()
|
||||
func getAllDHCPNameservers(ctx context.Context) []string {
|
||||
logger := LoggerFromCtx(ctx)
|
||||
|
||||
interfaces, err := net.Interfaces()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user