github.com/unicornultrafoundation/go-u2u@v1.0.0-rc1.0.20240205080301-e74a83d3fadc/logger/instance.go (about)

     1  package logger
     2  
     3  import (
     4  	"github.com/unicornultrafoundation/go-u2u/log"
     5  )
     6  
     7  type Instance struct {
     8  	Log log.Logger
     9  }
    10  
    11  func New(name ...string) Instance {
    12  	if len(name) == 0 {
    13  		return Instance{
    14  			Log: log.New(),
    15  		}
    16  	}
    17  	return Instance{
    18  		Log: log.New("module", name[0]),
    19  	}
    20  }