Printf
-like function without f
suffix GO-W6006575
576// Trace Log TRACE level message.
577// compatibility alias for Debug()
578func (bl *BeeLogger) Trace(format string, v ...interface{}) {579 if LevelDebug > bl.level {
580 return
581 }
559
560// Info Log INFO level message.
561// compatibility alias for Informational()
562func (bl *BeeLogger) Info(format string, v ...interface{}) {563 if LevelInfo > bl.level {
564 return
565 }
543
544// Warn Log WARN level message.
545// compatibility alias for Warning()
546func (bl *BeeLogger) Warn(format string, v ...interface{}) {547 if LevelWarn > bl.level {
548 return
549 }
527}
528
529// Debug Log DEBUG level message.
530func (bl *BeeLogger) Debug(format string, v ...interface{}) {531 if LevelDebug > bl.level {
532 return
533 }
512}
513
514// Informational Log INFORMATIONAL level message.
515func (bl *BeeLogger) Informational(format string, v ...interface{}) {516 if LevelInfo > bl.level {
517 return
518 }
For Printf
-like functions they should be named correctly so that consumers of the function
use it correctly. It is recommended to use f
as suffix for such functions to make it clear
that arguments are preceded with format specifier.
func glog(format string, args ...any) {
log.Printf("glog " + format, args...)
}
func dump(w io.Writer, prefix, format string, args ...any) {
fmt.Fprintf(w, "dump " + format, args...)
}
func glogf(format string, args ...any) {
log.Printf("glog " + format, args...)
}
func dumpf(w io.Writer, prefix, format string, args ...any) {
fmt.Fprintf(w, "dump " + format, args...)
}