// Log a message and a set of key/value pairs if the given level is at
// or more severe that the threshold configured in the Logger.
771414
func (l *intLogger) Log(level Level, msg string, args ...interface{}) {
	if level < Level(atomic.LoadInt32(l.level)) {
		return
	}

	t := time.Now()

	l.mutex.Lock()
	defer l.mutex.Unlock()

	if l.json {
		l.logJSON(t, level, msg, args...)
	} else {
		l.log(t, level, msg, args...)
	}

	l.writer.Flush(level)
}
1041311
func (sink *ReconfigurableSink) Log(level LogLevel, log []byte) {
	minLogLevel := LogLevel(atomic.LoadInt32(&sink.minLogLevel))

	if level < minLogLevel {
		return
	}

	sink.sink.Log(level, log)
}
73430
func (s *XormLogger) Level() core.LogLevel {
	switch s.level {
	case glog.LvlError:
		return core.LOG_ERR
	case glog.LvlWarn:
		return core.LOG_WARNING
	case glog.LvlInfo:
		return core.LOG_INFO
	case glog.LvlDebug:
		return core.LOG_DEBUG
	default:
		return core.LOG_ERR
	}
}
284746
func (l *Logger) Logf(level Level, format string, args ...interface{}) {
	msg := fmt.Sprintf(format, args...)
	l.Log(level, msg)
}
1230978
func (p *XPod) Log(level hlog.LogLevel, args ...interface{}) {
	hlog.HLog(level, p, 1, args...)
}
7272
func (c *Console) Log(e log.Entry) {

	var b []byte
	var lvl string
	var i int

	if c.displayColor {
		color := c.colors[e.Level]

		b = append(b, e.Timestamp.Format(c.timestampFormat)...)
		b = append(b, space)
		b = append(b, color...)

		lvl = e.Level.String()

		for i = 0; i < 6-len(lvl); i++ {
			b = append(b, space)
		}
		b = append(b, lvl...)
		b = append(b, ansi.Reset...)
		b = append(b, space)
		b = append(b, e.Message...)

		for _, f := range e.Fields {
			b = append(b, space)
			b = append(b, color...)
			b = append(b, f.Key...)
			b = append(b, ansi.Reset...)
			b = append(b, equals)

			switch t := f.Value.(type) {
			case string:
				b = append(b, t...)
			case int:
				b = strconv.AppendInt(b, int64(t), base10)
			case int8:
				b = strconv.AppendInt(b, int64(t), base10)
			case int16:
				b = strconv.AppendInt(b, int64(t), base10)
			case int32:
				b = strconv.AppendInt(b, int64(t), base10)
			case int64:
				b = strconv.AppendInt(b, t, base10)
			case uint:
				b = strconv.AppendUint(b, uint64(t), base10)
			case uint8:
				b = strconv.AppendUint(b, uint64(t), base10)
			case uint16:
				b = strconv.AppendUint(b, uint64(t), base10)
			case uint32:
				b = strconv.AppendUint(b, uint64(t), base10)
			case uint64:
				b = strconv.AppendUint(b, t, base10)
			case float32:
				b = strconv.AppendFloat(b, float64(t), 'f', -1, 32)
			case float64:
				b = strconv.AppendFloat(b, t, 'f', -1, 64)
			case bool:
				b = strconv.AppendBool(b, t)
			default:
				b = append(b, fmt.Sprintf(v, f.Value)...)
			}
		}

		b = append(b, newLine)
	} else {
		b = append(b, e.Timestamp.Format(c.timestampFormat)...)
		b = append(b, space)

		lvl = e.Level.String()

		for i = 0; i < 6-len(lvl); i++ {
			b = append(b, space)
		}

		b = append(b, lvl...)
		b = append(b, space)
		b = append(b, e.Message...)

		for _, f := range e.Fields {
			b = append(b, space)
			b = append(b, f.Key...)
			b = append(b, equals)

			switch t := f.Value.(type) {
			case string:
				b = append(b, t...)
			case int:
				b = strconv.AppendInt(b, int64(t), base10)
			case int8:
				b = strconv.AppendInt(b, int64(t), base10)
			case int16:
				b = strconv.AppendInt(b, int64(t), base10)
			case int32:
				b = strconv.AppendInt(b, int64(t), base10)
			case int64:
				b = strconv.AppendInt(b, t, base10)
			case uint:
				b = strconv.AppendUint(b, uint64(t), base10)
			case uint8:
				b = strconv.AppendUint(b, uint64(t), base10)
			case uint16:
				b = strconv.AppendUint(b, uint64(t), base10)
			case uint32:
				b = strconv.AppendUint(b, uint64(t), base10)
			case uint64:
				b = strconv.AppendUint(b, t, base10)
			case float32:
				b = strconv.AppendFloat(b, float64(t), 'f', -1, 32)
			case float64:
				b = strconv.AppendFloat(b, t, 'f', -1, 64)
			case bool:
				b = strconv.AppendBool(b, t)
			default:
				b = append(b, fmt.Sprintf(v, f.Value)...)
			}
		}

		b = append(b, newLine)
	}
	_, _ = c.writer.Write(b)
}
1049179
func (d DefaultLogger) Log(level LogLevel, a ...interface{}) (n int, err error) {
	if level >= logThreshhold {
		fmt.Fprint(os.Stderr, prefix(level)+" ")
		return fmt.Fprintln(os.Stderr, a...)
	}
	return 0, nil
}
957329
func (l *Logger) Log(severity int, msg string, fields map[string]interface{}) error {
	if severity > l.Threshold() {
		return nil
	}

	// format the message before acquiring mutex for better concurrency.
	t := time.Now()
	buf := pool.Get().([]byte)
	defer pool.Put(buf)

	b, err := l.Formatter().Format(buf, l, t, severity, msg, fields)
	if err != nil {
		return err
	}

	l.mu.Lock()
	defer l.mu.Unlock()

	if l.output == nil {
		return nil
	}

	_, err = l.output.Write(b)
	if err == nil {
		return nil
	}
	err = l.handleError(err)
	if err == nil {
		return nil
	}
	return errors.Wrap(err, "Logger.Log")
}
943490
func (l *Logger) Log(level LogLevel, v ...interface{}) {
	if l.getLevel() <= level {
		l.getHandler().Log(l.name, level, fmt.Sprint(v...), 1)
	}
}
770894
func (u *Ugen) Log() Input {
	return unaryOpLog(u.Rate, u, u.NumOutputs)
}
1200379
func (c MultiLogger) Log(keyvals ...interface{}) {
	for _, l := range c {
		if !IsDisabled(l) {
			l.Log(keyvals...)
		}
	}
}
631414
func (s *Scheme) Log(l conversion.DebugLogger) {
	s.converter.Debug = l
}
755395
func (n *panicLogger) Log(keyvals ...interface{}) {
	r := keyvals
	if n.err != nil {
		r = append(r[0:len(r):len(r)], n.err)
	}
	buf := &bytes.Buffer{}
	f := LogfmtLogger{
		Out:             buf,
		MissingValueKey: Msg,
	}
	if err := f.Log(r...); err != nil {
		panic(r)
	}
	panic(buf.String())
}
34485
func SetLogLevel(level string) {
	switch strings.ToLower(level) {
	case "debug":
		log.SetLevel(log.DebugLevel)
	case "info":
		log.SetLevel(log.InfoLevel)
	case "warn":
		log.SetLevel(log.WarnLevel)
	case "error":
		log.SetLevel(log.ErrorLevel)
	default:
		log.Fatalf("Unknown level: %s", level)
	}
}
819315
func (l *LogfmtLogger) Log(keyvals ...interface{}) error {
	// The Logger interface requires implementations to be safe for concurrent
	// use by multiple goroutines. For this implementation that means making
	// only one call to l.w.Write() for each call to Log. We first collect all
	// of the bytes into b, and then call l.w.Write(b).
	if len(keyvals)%2 != 0 {
		keyvals = append(keyvals[0:len(keyvals)-1:len(keyvals)-1], l.MissingValueKey, keyvals[len(keyvals)-1])
	}
	b, err := logfmt.MarshalKeyvals(keyvals...)
	if err != nil {
		return err
	}
	b = append(b, '\n')
	if _, err := l.Out.Write(b); err != nil {
		return errors.Annotate(err, "cannot write out logfmt for log")
	}
	return nil
}
523042
func CheckLevel(level string) error {
	if _, err := log.ParseLevel(level); err != nil {
		return fmt.Errorf(`log level not valid: "%s"`, level)
	}
	return nil
}
1336314
func (lo Logger) Log(pr Priority, me ...interface{}) {
	logMessage(lo, pr, me)
}