github.com/haraldrudell/parl@v0.4.176/internal/cyclebreaker/log.go (about)

     1  /*
     2  © 2023–present Harald Rudell <harald.rudell@gmail.com> (https://haraldrudell.github.io/haraldrudell/)
     3  ISC License
     4  */
     5  
     6  package cyclebreaker
     7  
     8  import (
     9  	"os"
    10  
    11  	"github.com/haraldrudell/parl/plog"
    12  )
    13  
    14  var output = func() (output func(calldepth int, s string) error) {
    15  	return plog.GetLog(os.Stderr).Output
    16  }()
    17  
    18  func Log(format string, a ...any) {
    19  	if err := output(0, Sprintf(format, a...)); err != nil {
    20  		panic(err)
    21  	}
    22  }