Documentation ¶
Index ¶
- Variables
- func Dump(v interface{})
- func FlushLogs()
- func HandleCrash(additionalHandlers ...func(interface{}))
- func InitLogs()
- func IsFileExist(fpath string) bool
- func IsSameConfig(src, dest string) (bool, error)
- func NewLogger(prefix string) *log.Logger
- func Until(f func(), period time.Duration, stopCh <-chan struct{})
- type GlogWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var NeverStop <-chan struct{} = make(chan struct{})
NeverStop may be passed to Until to make it never stop.
View Source
var PanicHandlers = []func(interface{}){logPanic}
PanicHandlers is a list of functions which will be invoked when a panic happens.
View Source
var ReallyCrash bool
For testing, bypass HandleCrash.
Functions ¶
func HandleCrash ¶
func HandleCrash(additionalHandlers ...func(interface{}))
HandleCrash simply catches a crash and logs an error. Meant to be called via defer. Additional context-specific handlers can be provided, and will be called in case of panic
func IsSameConfig ¶
IsSameConfig reports whether src and dest config files are equal. Two config files are equal when they have the same file contents and Unix permissions. The owner, group, and mode must match. It return false in other cases.
Types ¶
type GlogWriter ¶
type GlogWriter struct{}
GlogWriter serves as a bridge between the standard log package and the glog package.
Click to show internal directories.
Click to hide internal directories.