Documentation
¶
Index ¶
- Variables
- func GetKratosLogHelper() *log.Helper
- func GetKratosLogger() log.Logger
- func GetLogPath(logDir string, serviceName string) string
- func NewAsyncWriter(w io.Writer) *law.WriteAsyncer
- func NewFileWriter(logPath string) *lumberjack.Logger
- func SetGlobalLogger(l *Logger)
- func Sprint(args ...interface{}) string
- func SugaredLogger() *zap.SugaredLogger
- type CustomEncoder
- type Logger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Red = color.New(color.FgHiRed).SprintFunc() Blue = color.New(color.FgHiBlue).SprintFunc() Yellow = color.New(color.FgHiYellow).SprintFunc() Green = color.New(color.FgHiGreen).SprintFunc() )
View Source
var ColorResetStr = "\x1b[0m"
View Source
var LenColorResetStr = len(ColorResetStr)
Functions ¶
func GetKratosLogHelper ¶
func GetKratosLogger ¶
func GetLogPath ¶
func NewAsyncWriter ¶
func NewAsyncWriter(w io.Writer) *law.WriteAsyncer
func NewFileWriter ¶
func NewFileWriter(logPath string) *lumberjack.Logger
func SetGlobalLogger ¶
func SetGlobalLogger(l *Logger)
func Sprint ¶
func Sprint(args ...interface{}) string
Sprint 格式化参数,每个参数中间隔一个空格,返回格式化后的字符串 高效实现:使用strings.Builder预分配容量,减少内存分配,比fmt.Sprint更高效且确保参数间有空格
func SugaredLogger ¶
func SugaredLogger() *zap.SugaredLogger
Types ¶
type CustomEncoder ¶
func (*CustomEncoder) EncodeEntry ¶
Click to show internal directories.
Click to hide internal directories.