From 7702bfb0b557f97524807e0829b1d6acf4ddd447 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Fri, 9 Jan 2026 15:05:40 +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 }