mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
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:
committed by
Cuong Manh Le
parent
3beffd0dc8
commit
27c5be43c2
@@ -6,7 +6,9 @@ import "github.com/jaypipes/ghw"
|
|||||||
|
|
||||||
// GetChassisInfo retrieves hardware information including machine model type and vendor from the system profiler.
|
// GetChassisInfo retrieves hardware information including machine model type and vendor from the system profiler.
|
||||||
func GetChassisInfo() (*ChassisInfo, error) {
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user