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.
This commit is contained in:
Cuong Manh Le
2026-01-08 22:20:32 +07:00
committed by Cuong Manh Le
parent 3beffd0dc8
commit 27c5be43c2

View File

@@ -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
}