LogRecord
Type Alias: LogRecord
Section titled “Type Alias: LogRecord”LogRecord =
object
Defined in: types.ts:52
A structured log record. Transports receive these and decide what to do.
Records are plain JSON-serializable objects with no methods. The shape is stable - transports can safely persist or transmit them.
Properties
Section titled “Properties”
optionalargs?:unknown[]
Defined in: types.ts:88
Extra printf-style arguments for message. The console transport
substitutes %s/%d/%i/%f/%j/%o/%O/%%; JSON transports keep them
alongside the template.
context
Section titled “context”context:
Record<string,unknown>
Defined in: types.ts:63
Structured context attached at the log call or via child().
error?
Section titled “error?”
optionalerror?:SerializedError
Defined in: types.ts:65
Optional error, if .error() was called with one.
optionalkind?:string
Defined in: types.ts:75
Presentation tag a transport can map to a badge or colour without
abusing level (e.g. "success" → green ✔). log-kit never interprets it.
level:
LogLevel
Defined in: types.ts:59
Severity level.
message
Section titled “message”message:
string
Defined in: types.ts:61
Human-readable message (or a printf-style template when args is set).
optionalmeta?:Record<string,unknown>
Defined in: types.ts:82
Host-owned passthrough payload. log-kit never reads or mutates this — it
is a first-class escape hatch for wrappers that need to carry their own
entry shape (presentation data, original call, etc.) to a transport,
keeping context for the user’s structured data.
scope?
Section titled “scope?”
optionalscope?:string
Defined in: types.ts:70
Hierarchical scope, e.g. "app:manifest", set via child(name). A
presentation transport can render it as a prefix.
timestamp
Section titled “timestamp”timestamp:
string|number
Defined in: types.ts:57
Timestamp at record creation. An ISO 8601 string by default; a number (epoch ms) or other shape when LoggerConfig.timestamp is set.