Documentation ¶
Overview ¶
Package logger ...
Package logger ...
Package logger ...
Package logger ...
Package logger ...
Index ¶
- Constants
- func Close()
- func Debug(tag DLTag, args ...interface{})
- func Debugf(ctx context.Context, tag DLTag, format string, args ...interface{})
- func Error(tag DLTag, args ...interface{})
- func Errorf(ctx context.Context, tag DLTag, format string, args ...interface{})
- func Fatal(tag DLTag, args ...interface{})
- func Fatalf(ctx context.Context, tag DLTag, format string, args ...interface{})
- func Info(tag DLTag, args ...interface{})
- func Infof(ctx context.Context, tag DLTag, format string, args ...interface{})
- func InitTrack(sec config.Sectioner)
- func NewLoggerWithConfig(cfg config.Configer) error
- func PrintStack() []byte
- func Public(ctx context.Context, key string, pairs map[string]interface{})
- func PublicString(ctx context.Context, public string)
- func RegisterContextFormat(fn func(ctx context.Context) string)
- func RegisterLogger(obj Logger)
- func SetDepth(delt int)
- func Trace(tag DLTag, args ...interface{})
- func Tracef(ctx context.Context, tag DLTag, format string, args ...interface{})
- func Track(prefix, msg string)
- func Warn(tag DLTag, args ...interface{})
- func Warnf(ctx context.Context, tag DLTag, format string, args ...interface{})
- type DLTag
- type LogType
- type Logger
- type Option
- func SetAutoClear(autoClear bool) Option
- func SetAutoClearHours(keepHours int) Option
- func SetFileCallerDepth(dep int) Option
- func SetFormat(format string) Option
- func SetLinkable(useSoftLink bool) Option
- func SetMaxLevel(logLevel string) Option
- func SetPrefix(prefix string) Option
- func SetRotateByHour() Option
- func SetSeprate(seprated bool) Option
Constants ¶
View Source
const ( // DLTagUndefined .. DLTagUndefined DLTag = " _undef" // DLTagModuleStart ... DLTagModuleStart = " _com_module_start" // DLTagModuleStop ... DLTagModuleStop = " _com_module_stop" // DLTagConfLoad ... DLTagConfLoad = " _com_conf_load" // DLTagConfReload ... DLTagConfReload = " _com_conf_reload" // DLTagDataLoad ... DLTagDataLoad = " _com_data_load" // DLTagDataReload ... DLTagDataReload = " _com_data_reload" // DLTagMysqlFailed ... DLTagMysqlFailed = " _com_mysql_failed" // DLTagRedisFailed ... DLTagRedisFailed = " _com_redis_failure" // DLTagThriftFailed ... DLTagThriftFailed = " _com_thrift_failure" // DLTagThriftSuccess ... DLTagThriftSuccess = " _com_thrift_success" // DLTagHTTPSuccess ... DLTagHTTPSuccess = " _com_http_success" // DLTagHTTPFailed ... DLTagHTTPFailed = " _com_http_failure" // DLTagBackendRPCFailed ... DLTagBackendRPCFailed = " _com_interactive_failure" // DLTagRequestIn ... DLTagRequestIn = " _com_request_in" // DLTagRequestOut ... DLTagRequestOut = " _com_request_out" // DLTagTegPushSend ... DLTagTegPushSend = " _com_teg_push_send" // DLTagTegPushRecv ... DLTagTegPushRecv = " _com_teg_push_recv" )
View Source
const ( //TRACE :logLevel TRACE TRACE logLevel = iota //DEBUG :logLevel DEBUG DEBUG //INFO :logLevel INFO INFO //WARNING :logLevel WARNING WARNING //ERROR :logLevel ERROR ERROR //FATAL :logLevel FATAL FATAL )
View Source
const ( //LogTypeStdout :Log Type Stdout LogTypeStdout = "stdout" //LogTypeFile :Log Type File LogTypeFile = "file" )
Variables ¶
This section is empty.
Functions ¶
func NewLoggerWithConfig ¶
NewLoggerWithConfig :by cfg
func RegisterContextFormat ¶
RegisterContextFormat ...
Types ¶
type Logger ¶
type Logger interface { //Trace :Trace interface for log Trace(args ...interface{}) //Tracef :Tracef interface for log Tracef(format string, args ...interface{}) //Debug :Debug interface for log Debug(args ...interface{}) //Debugf :Debugf interface for log Debugf(format string, args ...interface{}) //Info :Info interface for log Info(args ...interface{}) //Infof :Infof interface for log Infof(format string, args ...interface{}) //Warn :Warn interface for log Warn(args ...interface{}) //Warnf :Warnf interface for log Warnf(format string, args ...interface{}) //Error :Error interface for log Error(args ...interface{}) //Errorf :Errorf interface for log Errorf(format string, args ...interface{}) //Fatal :Fatal interface for log Fatal(args ...interface{}) //Fatalf :Fatalf interface for log Fatalf(format string, args ...interface{}) //Close :Close interface for log Close() }
Logger :interface for log
func NewLoggerWithOption ¶
NewLoggerWithOption ...
type Option ¶
type Option func(fs *fileSetting)
Option ...
func SetAutoClearHours ¶
SetAutoClearHours 清理keepHours小时以前的日志
Source Files ¶
Click to show internal directories.
Click to hide internal directories.