// Logm sends a JSON log message to the configured host
978087
func (l *JSONLogger) Logm(timestamp time.Time, level gomol.LogLevel, attrs map[string]interface{}, msg string) error {
	if !l.isInitialized {
		return errors.New("JSON logger has not been initialized")
	}

	msgBytes, err := l.marshalJSON(timestamp, level, attrs, msg)
	if err != nil {
		return err
	}
	msgBytes = append(msgBytes, l.config.MessageDelimiter...)

	if !l.isConnected {
		// If we're not connected then just queue up the message and return
		// an error about not being connected
		l.queueFailure(msgBytes)
		return errors.New("Could not send message")
	}

	err = l.write(msgBytes)
	if err != nil {
		if neterr, ok := err.(net.Error); ok {
			if !neterr.Temporary() {
				// If this isn't a temporary error then queue the message
				// to the failed queue and start reconnecting
				l.queueFailure(msgBytes)
				l.performReconnect()
				return errors.New("Could not send message")
			}
		}
		return err
	}

	return nil
}
53401
func (m *Message) Loggable() map[string]interface{} {
	return map[string]interface{}{
		"message": map[string]string{
			"type": m.Type.String(),
			"key":  b58.Encode([]byte(m.GetKey())),
		},
	}
}
570614
func (entry *Entry) Logf(level Level, format string, args ...interface{}) {
	if entry.Logger.IsLevelEnabled(level) {
		entry.Log(level, fmt.Sprintf(format, args...))
	}
}
208522
func (l TestLogger) Logf(fmt string, values ...interface{}) {
	l.t.Logf(fmt, values...)
}
1188521
func (mp *LogMergePolicy) message(message string, w *IndexWriter) {
	if mp.verbose(w) {
		w.infoStream.Message("LMP", message)
	}
}
1202301
func (s *Server) logf(format string, args ...interface{}) {
	if s.ErrorLog != nil {
		s.ErrorLog.Printf(format, args...)
	} else {
		log.Printf(format, args...)
	}
}
915612
func JSON(l *Slog) ([]byte, error) {
	m := strings.Replace(l.Log.FormatMessage(), "\n", " ", -1)
	if len(m) > 0 && m[len(m)-1] == ' ' {
		m = m[:len(m)-1]
	}
	buf := Pool.Get().([]byte)
	buf = append(buf, domain...)
	buf = append(buf, l.Log.Domain...)
	buf = append(buf, prio...)
	buf = append(buf, l.Log.Priority.Byte()...)
	buf = append(buf, ts...)
	formatJSONTime(&buf, l.Log.Timestamp)
	buf = append(buf, l.Log.zoneBuf...)
	buf = append(buf, tgs...)
	l.Log.Tags.EncodeJSON(&buf)
	buf = append(buf, msg...)
	buf = append(buf, []byte(m)...)
	buf = append(buf, file...)
	if l.Log.DoDi {
		buf = append(buf, []byte(l.Log.file)...)
	}
	buf = append(buf, closeing...)
	return buf, nil
}
1336314
func (lo Logger) Log(pr Priority, me ...interface{}) {
	logMessage(lo, pr, me)
}
947982
func NewJSONLoggerConfig(hostURI string) *JSONLoggerConfig {
	return &JSONLoggerConfig{
		netDial: net.DialTimeout,

		HostURI:     hostURI,
		DialTimeout: 60 * time.Second,

		MessageDelimiter: []byte("\n"),

		FieldPrefix:      "",
		UnprefixedFields: []string{},

		LogLevelField:  "level",
		MessageField:   "message",
		TimestampField: "timestamp",

		LogLevelMap: map[gomol.LogLevel]interface{}{
			gomol.LevelDebug:   gomol.LevelDebug.String(),
			gomol.LevelInfo:    gomol.LevelInfo.String(),
			gomol.LevelWarning: gomol.LevelWarning.String(),
			gomol.LevelError:   gomol.LevelError.String(),
			gomol.LevelFatal:   gomol.LevelFatal.String(),
			gomol.LevelNone:    gomol.LevelNone.String(),
		},

		JSONAttrs: map[string]interface{}{},

		FailureQueueLength: 100,

		ReconnectBackoff: backoff.NewExponentialBackoff(
			100*time.Millisecond,
			time.Minute,
		),
	}
}
1164032
func Log(num, base cty.Value) (cty.Value, error) {
	return LogFunc.Call([]cty.Value{num, base})
}
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")
}
851436
func (l *JSONFileLogger) Log(msg *logger.Message) error {
	l.mu.Lock()
	err := l.writer.WriteLogEntry(msg)
	l.mu.Unlock()
	return err
}
1362208
func Log(serviceName string, methodName string, request proto.Message, response proto.Message, err error, duration time.Duration) {
	if err != nil {
		Error(serviceName, methodName, request, response, err, duration)
	} else {
		Info(serviceName, methodName, request, response, err, duration)
	}
}
162522
func (w *Window) Log(message string) (err error) {
	if err = w.isActionable(); err != nil {
		return
	}
	return w.w.write(Event{Message: newEventMessage(message), Name: EventNameWindowCmdLog, TargetID: w.id})
}
141235
func (l *Logger) Noticem(attrs map[string]interface{}, format string, va ...interface{}) error {
	return l.logMsg(attrs, LEVEL_NOTICE, format, va...)
}
1195798
func (fsm *SimpleFSM) Logs() [][]byte {
	fsm.mu.Lock()
	defer fsm.mu.Unlock()
	copied := make([][]byte, len(fsm.logs))
	copy(copied, fsm.logs)
	return copied
}
1308407
func Log(lvl level, source, message string) {
	Global.Log(lvl, source, message)
}