fix(config): replace stdout logging with proper logging system
- commit
- 11227e89570a844658029a384956e1facfc4ea81
- author
- bamen · · 2025-09-12 13:01 UTC
- parent
- e3615c6
- signature
- unsigned
1 file · +4 -3
M internal/config/config.go +4 -3
| @@ -11,6 +11,7 @@ import ( | |||
| 11 | 11 | "sync" | |
| 12 | 12 | "time" | |
| 13 | 13 | ||
| 14 | + | "github.com/bnema/dumber/internal/logging" | |
| 14 | 15 | "github.com/bnema/dumber/pkg/gpu" | |
| 15 | 16 | "github.com/fsnotify/fsnotify" | |
| 16 | 17 | "github.com/spf13/viper" | |
| @@ -602,7 +603,7 @@ func (m *Manager) validateAndConfigureCodecPreferences(config *Config) *Config { | |||
| 602 | 603 | // Get detailed AV1 capabilities | |
| 603 | 604 | av1Caps := gpuInfo.GetAV1HardwareCapabilities() | |
| 604 | 605 | if av1Caps["decode"] { | |
| 605 | - | fmt.Printf("Config: GPU supports AV1 hardware decode\n") | |
| 606 | + | logging.Info("GPU supports AV1 hardware decode") | |
| 606 | 607 | ||
| 607 | 608 | // If GPU supports AV1, prefer it over VP9 | |
| 608 | 609 | if !config.CodecPreferences.ForceAV1 && | |
| @@ -619,8 +620,8 @@ func (m *Manager) validateAndConfigureCodecPreferences(config *Config) *Config { | |||
| 619 | 620 | } | |
| 620 | 621 | ||
| 621 | 622 | // Log GPU-specific codec capabilities | |
| 622 | - | fmt.Printf("Config: %s GPU codec capabilities - AV1: decode=%t, encode=%t, 10bit=%t\n", | |
| 623 | - | gpuInfo.Vendor, av1Caps["decode"], av1Caps["encode"], av1Caps["10bit"]) | |
| 623 | + | logging.Info(fmt.Sprintf("%s GPU codec capabilities - AV1: decode=%t, encode=%t, 10bit=%t", | |
| 624 | + | gpuInfo.Vendor, av1Caps["decode"], av1Caps["encode"], av1Caps["10bit"])) | |
| 624 | 625 | } | |
| 625 | 626 | ||
| 626 | 627 | return config | |
| @@ -11,6 +11,7 @@ import ( | |||||
| 11 | "sync" | 11 | "sync" | ||
| 12 | "time" | 12 | "time" | ||
| 13 | 13 | ||||
| 14 | + | "github.com/bnema/dumber/internal/logging" | |||
| 14 | "github.com/bnema/dumber/pkg/gpu" | 15 | "github.com/bnema/dumber/pkg/gpu" | ||
| 15 | "github.com/fsnotify/fsnotify" | 16 | "github.com/fsnotify/fsnotify" | ||
| 16 | "github.com/spf13/viper" | 17 | "github.com/spf13/viper" | ||
| @@ -602,7 +603,7 @@ func (m *Manager) validateAndConfigureCodecPreferences(config *Config) *Config { | |||||
| 602 | // Get detailed AV1 capabilities | 603 | // Get detailed AV1 capabilities | ||
| 603 | av1Caps := gpuInfo.GetAV1HardwareCapabilities() | 604 | av1Caps := gpuInfo.GetAV1HardwareCapabilities() | ||
| 604 | if av1Caps["decode"] { | 605 | if av1Caps["decode"] { | ||
| 605 | - | fmt.Printf("Config: GPU supports AV1 hardware decode\n") | 606 | + | logging.Info("GPU supports AV1 hardware decode") |
| 606 | 607 | ||||
| 607 | // If GPU supports AV1, prefer it over VP9 | 608 | // If GPU supports AV1, prefer it over VP9 | ||
| 608 | if !config.CodecPreferences.ForceAV1 && | 609 | if !config.CodecPreferences.ForceAV1 && | ||
| @@ -619,8 +620,8 @@ func (m *Manager) validateAndConfigureCodecPreferences(config *Config) *Config { | |||||
| 619 | } | 620 | } | ||
| 620 | 621 | ||||
| 621 | // Log GPU-specific codec capabilities | 622 | // Log GPU-specific codec capabilities | ||
| 622 | - | fmt.Printf("Config: %s GPU codec capabilities - AV1: decode=%t, encode=%t, 10bit=%t\n", | 623 | + | logging.Info(fmt.Sprintf("%s GPU codec capabilities - AV1: decode=%t, encode=%t, 10bit=%t", |
| 623 | - | gpuInfo.Vendor, av1Caps["decode"], av1Caps["encode"], av1Caps["10bit"]) | 624 | + | gpuInfo.Vendor, av1Caps["decode"], av1Caps["encode"], av1Caps["10bit"])) |
| 624 | } | 625 | } | ||
| 625 | 626 | ||||
| 626 | return config | 627 | return config | ||