MCPcopy Index your code
hub / github.com/coder/slog / Log

Method Log

slog.go:38–49  ·  view source on GitHub ↗

Log logs the given entry with the context to the underlying sinks. It extends the entry with the set fields and names.

(ctx context.Context, e SinkEntry)

Source from the content-addressed store, hash-verified

36//
37// It extends the entry with the set fields and names.
38func (l Logger) Log(ctx context.Context, e SinkEntry) {
39 if e.Level < l.level {
40 return
41 }
42
43 e.Fields = l.fields.append(e.Fields)
44 e.LoggerNames = appendNames(l.names, e.LoggerNames...)
45
46 for _, s := range l.sinks {
47 s.LogEntry(ctx, e)
48 }
49}
50
51// Sync calls Sync on all the underlying sinks.
52func (l Logger) Sync() {

Callers 1

logMethod · 0.95

Calls 3

appendNamesFunction · 0.85
appendMethod · 0.80
LogEntryMethod · 0.65

Tested by

no test coverage detected