func (tf *TextFormatter) Format(writer io.Writer, level int, msg string, args []interface{}) {
	buf := pool.Get()
	defer pool.Put(buf)
	buf.WriteString("_t=")
	buf.WriteString(time.Now().Format(timeFormat))
	buf.WriteString(tf.itoaLevelMap[level])
	buf.WriteString(msg)
	var lenArgs = len(args)
	if lenArgs > 0 {
		if lenArgs%2 == 0 {
			for i := 0; i < lenArgs; i += 2 {
				if key, ok := args[i].(string); ok {
					if key == "" {
						// show key is invalid
						tf.set(buf, badKeyAtIndex(i), args[i+1])
					} else {
						tf.set(buf, key, args[i+1])
					}
				} else {
					// show key is invalid
					tf.set(buf, badKeyAtIndex(i), args[i+1])
				}
			}
		} else {
			tf.set(buf, warnImbalancedKey, args)
		}
	}
	buf.WriteRune('\n')
	buf.WriteTo(writer)
}
// Format records a log entry.
Format records a log entry.
// Format records a log entry .
func (tf *TextFormatter) Format(writer io.Writer, level int, msg string, args []interface{}) {
	buf := pool.Get()
	defer pool.Put(buf)
	buf.WriteString("_t=")
	buf.WriteString(time.Now().Format(timeFormat))
	buf.WriteString(tf.itoaLevelMap[level])
	buf.WriteString(msg)
	var lenArgs = len(args)
	if lenArgs > 0 {
		if lenArgs%2 == 0 {
			for i := 0; i < lenArgs; i += 2 {
				if key, ok := args[i].(string); ok {
					if key == "" {
						tf.set(buf, badKeyAtIndex(i), args[i+1])
					} else {
						tf.set(buf, key, args[i+1])
					}
				} else {
					tf.set(buf, badKeyAtIndex(i), args[i+1])
				}
			}
		} else {
			tf.set(buf, warnImbalancedKey, args)
		}
	}
	buf.WriteRune('\n')
	buf.WriteTo(writer)
}
func ( tf * TextFormatter ) Format ( writer io . Writer , level int , msg string , args [ ] interface { } ) { buf := pool . Get ( ) defer pool . Put ( buf ) buf . WriteString ( " " ) buf . WriteString ( time . Now ( ) . Format ( timeFormat ) ) buf . WriteString ( tf . itoaLevelMap [ level ] ) buf . WriteString ( msg ) var lenArgs = len ( args ) if lenArgs > 0 { if lenArgs % 2 == 0 { for i := 0 ; i < lenArgs ; i += 2 { if key , ok := args [ i ] . ( string ) ; ok { if key == " " { tf . set ( buf , badKeyAtIndex ( i ) , args [ i + 1 ] ) } else { tf . set ( buf , key , args [ i + 1 ] ) } } else { tf . set ( buf , badKeyAtIndex ( i ) , args [ i + 1 ] ) } } } else { tf . set ( buf , warnImbalancedKey , args ) } } buf . WriteRune ( '\n' ) buf . WriteTo ( writer ) }
Format records a log entry.
Format records a log entry .
// show key is invalid // show key is invalid