// Log logs the key/value pairs to the logger's output.
Log logs the key/value pairs to the logger's output.
// Log logs the key / value pairs to the logger ' s output .
func (l *KVLogger) Log(data kv) {
	var file string
	var line int
	var ok bool
	_, file, line, ok = runtime.Caller(2)
	if ok {
		file = path.Base(file)
	} else {
		file = "???"
		line = 0
	}
	out := fmt.Sprintf("%s %s lfs[%d] [%s:%d]: ", time.Now().UTC().Format(time.RFC3339), hostname, pid, file, line)
	var vals []string
	for k, v := range data {
		vals = append(vals, fmt.Sprintf("%s=%v", k, v))
	}
	out += strings.Join(vals, " ")
	l.mu.Lock()
	fmt.Fprint(l.w, out+"\n")
	l.mu.Unlock()
}
func ( l * KVLogger ) Log ( data kv ) { var file string var line int var ok bool _ , file , line , ok = runtime . Caller ( 2 ) if ok { file = path . Base ( file ) } else { file = " " line = 0 } out := fmt . Sprintf ( " " , time . Now ( ) . UTC ( ) . Format ( time . RFC3339 ) , hostname , pid , file , line ) var vals [ ] string for k , v := range data { vals = append ( vals , fmt . Sprintf ( " " , k , v ) ) } out += strings . Join ( vals , " " ) l . mu . Lock ( ) fmt . Fprint ( l . w , out + " \n " ) l . mu . Unlock ( ) }
Log logs the key/value pairs to the logger's output.
Log logs the key / value pairs to the logger ' s output .