We write a comprehensive tooling for TXT and BootGuard, and we need to avoid any logs print by fiano. But fiano does not allow to do that. And here's a simple experiment:
type panicWriter struct{}
func (panicWriter) Write(b []byte) (int, error) {
panic("PANIC")
}
log.SetOutput(panicWriter{})
...
flash, err := uefi.NewFlashImage(image)
if err != nil {
return 0, 0, fmt.Errorf("count not initialize a flash image: %w", err)
}
And we need to suppress this log.Printf. The only thing we can do is log.SetOutput(ioutil.Discard), but we would like to avoid modifying a global logger.
So as a quick solution I propose to add package log to fiano and define a logger there, which will be used everywhere else within fiano. Any opinions?
We write a comprehensive tooling for TXT and BootGuard, and we need to avoid any logs print by
fiano
. But fiano does not allow to do that. And here's a simple experiment:Then run it against coreboot and get:
What happens is:
uefi.NewFlashImage
.uefi.NewFlashImage
callsuefi.NewMERegion
.uefi.NewMERegion
callslog.Printf
.And we need to suppress this
log.Printf
. The only thing we can do islog.SetOutput(ioutil.Discard)
, but we would like to avoid modifying a global logger.So as a quick solution I propose to add package
log
tofiano
and define a logger there, which will be used everywhere else withinfiano
. Any opinions?