AFAIRE
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
logger/format.go

34 lines
877 B

/*
------------------------------------------------------------------------------------------------------------------------
####### logger ####### Copyright (c) 2021 losyme ################################################### MIT License #######
------------------------------------------------------------------------------------------------------------------------
*/
package logger
import (
"strings"
"forge.chapril.org/losyme/buffer"
)
const (
_maxIDLen = 8
_maxNameLen = 10
)
const _bufSize = 256
var BufPool = buffer.NewPool(_bufSize)
func loggerLabel(id, name string) string {
a := name[:_maxNameLen]
b := id[:_maxIDLen]
return strings.Repeat(".", _maxNameLen-len(a)) + a + ":" + strings.Repeat(".", _maxIDLen-len(b)) + b
}
/*
######################################################################################################## @(°_°)@ #######
*/