> Any feedback is much appreciated.
There is way too much going on in this code whose feature essentially boils down to
func Printf(f string, v ...any) {
if CONDITION {
fmt.Printf(f, v...)
}
}
Writing a stack trace is fully unrelated to Printf(), and should be separated.