func (p *XConsoleLog) Noticex(logID, format string, a ...interface{}) error {
	if p.level > NoticeLevel {
		return nil
	}
	logText := formatValue(format, a...)
	return p.write(NoticeLevel, &logText, logID)
}
Noticex implements XLogger
package xlog
import (
	"fmt"
	"os"
	"path/filepath"
	"strconv"
	"time"
)
const (
	XConsoleLogDefaultlogID = "800000001"
)
type XConsoleLog struct {
	level int
	skip     int
	hostname string
	service  string
}
type Brush func(string) string
func NewBrush(color string) Brush {
	pre := "\033["
	reset := "\033[0m"
	return func(text string) string {
		return pre + color + "m" + text + reset
	}
}
var colors = []Brush{
	NewBrush("1;37"),  
	NewBrush("1;36"),  
	NewBrush("1;35"),  
	NewBrush("1;31"),  
	NewBrush("1;33"),  
	NewBrush("1;32"),  
	NewBrush("1;34"),  
	NewBrush("1;34"),  
}
func NewXConsoleLog() XLogger {
	return &XConsoleLog{
		skip: XLogDefSkipNum,
	}
}
func (p *XConsoleLog) Init(config map[string]string) (err error) {
	level, ok := config["level"]
	if !ok {
		err = fmt.Errorf("init XConsoleLog failed, not found level")
		return
	}
	service, _ := config["service"]
	if len(service) > 0 {
		p.service = service
	}
	skip, _ := config["skip"]
	if len(skip) > 0 {
		skipNum, err := strconv.Atoi(skip)
		if err == nil {
			p.skip = skipNum
		}
	}
	p.level = LevelFromStr(level)
	hostname, _ := os.Hostname()
	p.hostname = hostname
	return
}
func (p *XConsoleLog) SetLevel(level string) {
	p.level = LevelFromStr(level)
}
func (p *XConsoleLog) SetSkip(skip int) {
	p.skip = skip
}
func (p *XConsoleLog) ReOpen() error {
	return nil
}
func (p *XConsoleLog) Warn(format string, a ...interface{}) error {
	return p.warnx(XConsoleLogDefaultlogID, format, a...)
}
func (p *XConsoleLog) Warnx(logID, format string, a ...interface{}) error {
	return p.warnx(logID, format, a...)
}
func (p *XConsoleLog) warnx(logID, format string, a ...interface{}) error {
	if p.level > WarnLevel {
		return nil
	}
	logText := formatValue(format, a...)
	fun, filename, lineno := getRuntimeInfo(p.skip)
	color := colors[WarnLevel]
	logText = color(fmt.Sprintf("[%s:%s:%d] %s", fun, filepath.Base(filename), lineno, logText))
	return p.write(WarnLevel, &logText, logID)
}
func (p *XConsoleLog) Fatal(format string, a ...interface{}) error {
	return p.fatalx(XConsoleLogDefaultlogID, format, a...)
}
func (p *XConsoleLog) Fatalx(logID, format string, a ...interface{}) error {
	return p.fatalx(logID, format, a...)
}
func (p *XConsoleLog) fatalx(logID, format string, a ...interface{}) error {
	if p.level > FatalLevel {
		return nil
	}
	logText := formatValue(format, a...)
	fun, filename, lineno := getRuntimeInfo(p.skip)
	color := colors[FatalLevel]
	logText = color(fmt.Sprintf("[%s:%s:%d] %s", fun, filepath.Base(filename), lineno, logText))
	return p.write(FatalLevel, &logText, logID)
}
func (p *XConsoleLog) Notice(format string, a ...interface{}) error {
	return p.Noticex(XConsoleLogDefaultlogID, format, a...)
}