writer.go
func (f *FileLogger) logWriter() {
	defer func() {
		if err := recover(); err != nil {
			log.Printf("FileLogger's LogWritter() catch panic: %v\n", err)
		}
	}()

	//TODO let printInterVal can be configure, without change sourceCode
	printInterval := DEFAULT_PRINT_INTERVAL

	seqTimer := time.NewTicker(time.Duration(printInterval) * time.Second)
	for {
		select {
		case str := <-f.logChan:

			f.p(str)
		case <-seqTimer.C:
			f.p(fmt.Sprintf("================ LOG SEQ SIZE:%v ==================", len(f.logChan)))
		}
	}
}
func (f *FileLogger) logWriter() {
	defer func() {
		if err := recover(); err != nil {
			log.Printf("FileLogger's LogWritter() catch panic: %v\n", err)
		}
	}()

	//TODO let printInterVal can be configure, without change sourceCode
	printInterval := DEFAULT_PRINT_INTERVAL

	seqTimer := time.NewTicker(time.Duration(printInterval) * time.Second)
	for {
		select {
		case str := <-f.logChan:

			f.p(str)
		case <-seqTimer.C:
			f.p(fmt.Sprintf("================ LOG SEQ SIZE:%v ==================", len(f.logChan)))
		}
	}
}
func ( f * FileLogger ) logWriter ( ) { defer func ( ) { if err := recover ( ) ; err != nil { log . Printf ( " \n " , err ) } } ( ) //TODO let printInterVal can be configure, without change sourceCode printInterval := DEFAULT_PRINT_INTERVAL seqTimer := time . NewTicker ( time . Duration ( printInterval ) * time . Second ) for { select { case str := <- f . logChan : f . p ( str ) case <- seqTimer . C : f . p ( fmt . Sprintf ( " " , len ( f . logChan ) ) ) } } }
// Receive logStr from f's logChan and print logstr to file
Receive logStr from f s logChan and print logstr to file