This commit is contained in:
John Guo
2021-08-19 14:12:04 +08:00
2 changed files with 10 additions and 0 deletions

View File

@ -153,3 +153,8 @@ func GetLevelPrefix(level int) string {
func SetHandlers(handlers ...Handler) {
logger.SetHandlers(handlers...)
}
//SetWriterColorEnable sets the file logging with color
func SetWriterColorEnable(enabled bool) {
logger.SetWriterColorEnable(enabled)
}

View File

@ -249,3 +249,8 @@ func (l *Logger) SetPrefix(prefix string) {
func (l *Logger) SetHandlers(handlers ...Handler) {
l.config.Handlers = handlers
}
//SetWriterColorEnable sets the file logging with color
func (l *Logger) SetWriterColorEnable(enabled bool) {
l.config.WriterColorEnable = enabled
}