package grpclog
import (
"fmt"
)
type componentData struct {
name string
}
var cache = map [string ]*componentData {}
func (c *componentData ) InfoDepth (depth int , args ...any ) {
args = append ([]any {"[" + string (c .name ) + "]" }, args ...)
InfoDepth (depth +1 , args ...)
}
func (c *componentData ) WarningDepth (depth int , args ...any ) {
args = append ([]any {"[" + string (c .name ) + "]" }, args ...)
WarningDepth (depth +1 , args ...)
}
func (c *componentData ) ErrorDepth (depth int , args ...any ) {
args = append ([]any {"[" + string (c .name ) + "]" }, args ...)
ErrorDepth (depth +1 , args ...)
}
func (c *componentData ) FatalDepth (depth int , args ...any ) {
args = append ([]any {"[" + string (c .name ) + "]" }, args ...)
FatalDepth (depth +1 , args ...)
}
func (c *componentData ) Info (args ...any ) {
c .InfoDepth (1 , args ...)
}
func (c *componentData ) Warning (args ...any ) {
c .WarningDepth (1 , args ...)
}
func (c *componentData ) Error (args ...any ) {
c .ErrorDepth (1 , args ...)
}
func (c *componentData ) Fatal (args ...any ) {
c .FatalDepth (1 , args ...)
}
func (c *componentData ) Infof (format string , args ...any ) {
c .InfoDepth (1 , fmt .Sprintf (format , args ...))
}
func (c *componentData ) Warningf (format string , args ...any ) {
c .WarningDepth (1 , fmt .Sprintf (format , args ...))
}
func (c *componentData ) Errorf (format string , args ...any ) {
c .ErrorDepth (1 , fmt .Sprintf (format , args ...))
}
func (c *componentData ) Fatalf (format string , args ...any ) {
c .FatalDepth (1 , fmt .Sprintf (format , args ...))
}
func (c *componentData ) Infoln (args ...any ) {
c .InfoDepth (1 , args ...)
}
func (c *componentData ) Warningln (args ...any ) {
c .WarningDepth (1 , args ...)
}
func (c *componentData ) Errorln (args ...any ) {
c .ErrorDepth (1 , args ...)
}
func (c *componentData ) Fatalln (args ...any ) {
c .FatalDepth (1 , args ...)
}
func (c *componentData ) V (l int ) bool {
return V (l )
}
func Component (componentName string ) DepthLoggerV2 {
if cData , ok := cache [componentName ]; ok {
return cData
}
c := &componentData {componentName }
cache [componentName ] = c
return c
}
The pages are generated with Golds v0.8.2 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .