9elements / converged-security-suite

Converged Security Suite for Intel & AMD platform security features
https://www.9esec.io
BSD 3-Clause "New" or "Revised" License
59 stars 15 forks source link

Suppress fiano warning #221

Closed xaionaro closed 3 years ago

xaionaro commented 3 years ago

Fiano prints logs and this is non-disablable. See https://github.com/linuxboot/fiano/issues/330

In this PR I temporary suppress fiano-related logs when we call tools.GetRegion.

log.SetOutput uses a mutex, so it should be safe:

// SetOutput sets the output destination for the standard logger.
func SetOutput(w io.Writer) {
    std.mu.Lock()
    defer std.mu.Unlock()
    std.out = w
}
xaionaro commented 3 years ago

A better fix: https://github.com/linuxboot/fiano/pull/331