From 27c5be43c2f263cede210424305de461bd2ccf05 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Thu, 8 Jan 2026 22:20:32 +0700 Subject: [PATCH] fix(system): disable ghw warnings to reduce log noise Disable warnings from ghw library when retrieving chassis information. These warnings are undesirable but recoverable errors that emit unnecessary log messages. Using WithDisableWarnings() suppresses them while maintaining functionality. --- internal/system/chassis_others.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/system/chassis_others.go b/internal/system/chassis_others.go index cbfefa5..49e38aa 100644 --- a/internal/system/chassis_others.go +++ b/internal/system/chassis_others.go @@ -6,7 +6,9 @@ import "github.com/jaypipes/ghw" // GetChassisInfo retrieves hardware information including machine model type and vendor from the system profiler. func GetChassisInfo() (*ChassisInfo, error) { - chassis, err := ghw.Chassis() + // Disable warnings from ghw, since these are undesirable but recoverable errors. + // With warnings enabled, ghw will emit unnecessary log messages. + chassis, err := ghw.Chassis(ghw.WithDisableWarnings()) if err != nil { return nil, err }