You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
188 lines
5.4 KiB
Go
188 lines
5.4 KiB
Go
package starlog
|
|
|
|
import (
|
|
"io"
|
|
)
|
|
|
|
func (logger *StarLogger) SetShowColor(val bool) {
|
|
logger.logcore.showColor = val
|
|
}
|
|
|
|
func (logger *StarLogger) GetShowColor() bool {
|
|
return logger.logcore.showColor
|
|
}
|
|
|
|
func (logger *StarLogger) SetLevelColor(level int, color []Attr) {
|
|
logger.logcore.colorList[level] = color
|
|
logger.logcore.colorMe[level] = NewColor(color...)
|
|
}
|
|
|
|
func (logger *StarLogger) GetLevelColor(level int) []Attr {
|
|
return logger.logcore.colorList[level]
|
|
}
|
|
|
|
func (logger *StarLogger) SetWriter(wr io.Writer) {
|
|
logger.logcore.output = wr
|
|
}
|
|
func (logger *StarLogger) GetWriter() io.Writer {
|
|
return logger.logcore.output
|
|
}
|
|
|
|
func (logger *StarLogger) SetHandler(f func([]Attr, string)) {
|
|
logger.handlerFunc = f
|
|
}
|
|
func (logger *StarLogger) GetHandler() func([]Attr, string) {
|
|
return logger.handlerFunc
|
|
}
|
|
func (logger *StarLogger) SetSwitching(sw bool) {
|
|
logger.logcore.switching = sw
|
|
}
|
|
|
|
func (logger *StarLogger) SetShowOriginFile(val bool) {
|
|
logger.logcore.showDeatilFile = val
|
|
}
|
|
|
|
func (logger *StarLogger) GetShowOriginFile() bool {
|
|
return logger.logcore.showDeatilFile
|
|
}
|
|
|
|
func (logger *StarLogger) SetShowFuncName(val bool) {
|
|
logger.logcore.showFuncName = val
|
|
}
|
|
|
|
func (logger *StarLogger) GetShowFuncName() bool {
|
|
return logger.logcore.showFuncName
|
|
}
|
|
|
|
func (logger *StarLogger) SetShowLevel(val bool) {
|
|
logger.logcore.showLevel = val
|
|
}
|
|
|
|
func (logger *StarLogger) GetShowLevel() bool {
|
|
return logger.logcore.showLevel
|
|
}
|
|
|
|
func (logger *StarLogger) SetShowFlag(val bool) {
|
|
logger.logcore.showThread = val
|
|
}
|
|
|
|
func (logger *StarLogger) GetShowFlag() bool {
|
|
return logger.logcore.showThread
|
|
}
|
|
|
|
func (logger *StarLogger) SetShowStd(val bool) {
|
|
logger.logcore.showStd = val
|
|
}
|
|
|
|
func (logger *StarLogger) GetShowStd() bool {
|
|
return logger.logcore.showStd
|
|
}
|
|
|
|
func (logger *StarLogger) StopWrite() {
|
|
logger.logcore.stopWriter = true
|
|
}
|
|
|
|
func (logger *StarLogger) EnbaleWrite() {
|
|
logger.logcore.stopWriter = false
|
|
}
|
|
|
|
func (logger *StarLogger) IsWriteStoed() bool {
|
|
return logger.logcore.stopWriter
|
|
}
|
|
|
|
func (logger *StarLogger) Debug(str ...interface{}) {
|
|
logger.logcore.Debug(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Debugf(format string, str ...interface{}) {
|
|
logger.logcore.Debugf(logger.thread, logger.isStd, logger.handlerFunc, format, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Debugln(str ...interface{}) {
|
|
logger.logcore.Debugln(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Info(str ...interface{}) {
|
|
logger.logcore.Info(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Infof(format string, str ...interface{}) {
|
|
logger.logcore.Infof(logger.thread, logger.isStd, logger.handlerFunc, format, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Infoln(str ...interface{}) {
|
|
logger.logcore.Infoln(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Notice(str ...interface{}) {
|
|
logger.logcore.Notice(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Noticef(format string, str ...interface{}) {
|
|
logger.logcore.Noticef(logger.thread, logger.isStd, logger.handlerFunc, format, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Noticeln(str ...interface{}) {
|
|
logger.logcore.Noticeln(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Warning(str ...interface{}) {
|
|
logger.logcore.Warning(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Warningf(format string, str ...interface{}) {
|
|
logger.logcore.Warningf(logger.thread, logger.isStd, logger.handlerFunc, format, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Warningln(str ...interface{}) {
|
|
logger.logcore.Warningln(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Error(str ...interface{}) {
|
|
logger.logcore.Error(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Errorf(format string, str ...interface{}) {
|
|
logger.logcore.Errorf(logger.thread, logger.isStd, logger.handlerFunc, format, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Errorln(str ...interface{}) {
|
|
logger.logcore.Errorln(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Critical(str ...interface{}) {
|
|
logger.logcore.Critical(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Criticalf(format string, str ...interface{}) {
|
|
logger.logcore.Criticalf(logger.thread, logger.isStd, logger.handlerFunc, format, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Criticalln(str ...interface{}) {
|
|
logger.logcore.Criticalln(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Fatal(str ...interface{}) {
|
|
logger.logcore.Fatal(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Fatalf(format string, str ...interface{}) {
|
|
logger.logcore.Fatalf(logger.thread, logger.isStd, logger.handlerFunc, format, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Fatalln(str ...interface{}) {
|
|
logger.logcore.Fatalln(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Print(str ...interface{}) {
|
|
logger.logcore.Print(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Printf(format string, str ...interface{}) {
|
|
logger.logcore.Printf(logger.thread, logger.isStd, logger.handlerFunc, format, str...)
|
|
}
|
|
|
|
func (logger *StarLogger) Println(str ...interface{}) {
|
|
logger.logcore.Println(logger.thread, logger.isStd, logger.handlerFunc, str...)
|
|
}
|