import type { HrTime, SpanContext } from '@opentelemetry/api'; import type { InstrumentationScope } from '@opentelemetry/core'; import type { AnyValue, LogBody, LogAttributes, SeverityNumber } from '@opentelemetry/api-logs'; import type { Resource } from '@opentelemetry/resources'; /** * A recording of an event. Typically, the record includes a timestamp indicating when the * event happened as well as other data that describes what happened, where it happened, etc. * * @remarks * This interface is **not intended to be implemented by users**. * To produce logs, use {@link Logger#emit}. To consume logs, implement {@link LogRecordProcessor#onEmit}. * ReadWriteLogRecord instances are created and managed by the SDK. */ export interface ReadWriteLogRecord { hrTime: HrTime; hrTimeObserved: HrTime; spanContext?: SpanContext; readonly resource: Resource; /** * The instrumentation scope associated with the log record. * * Downstream consumers may group exported records by the identity of this * object. If a distinct grouping is required, construct a new scope object * instead of reusing an existing one. */ readonly instrumentationScope: InstrumentationScope; readonly attributes: LogAttributes; severityText?: string; severityNumber?: SeverityNumber; body?: LogBody; eventName?: string; droppedAttributesCount: number; /** * Sets a single attribute on the log record. * @param key The attribute key. * @param value The attribute value. * @returns The updated ReadWriteLogRecord. */ setAttribute(key: string, value?: AnyValue): ReadWriteLogRecord; /** * Sets multiple attributes on the log record. * @param attributes The attributes to set. * @returns The updated ReadWriteLogRecord. */ setAttributes(attributes: LogAttributes): ReadWriteLogRecord; /** * Sets the body of the log record. * @param body The log body. * @returns The updated ReadWriteLogRecord. */ setBody(body: LogBody): ReadWriteLogRecord; /** * Sets the event name for the log record. * @param eventName The event name. * @returns The updated ReadWriteLogRecord. */ setEventName(eventName: string): ReadWriteLogRecord; /** * Sets the severity number for the log record. * @param severityNumber The severity number. * @returns The updated ReadWriteLogRecord. */ setSeverityNumber(severityNumber: SeverityNumber): ReadWriteLogRecord; /** * Sets the severity text (log level) for the log record. * @param severityText The severity text. * @returns The updated ReadWriteLogRecord. */ setSeverityText(severityText: string): ReadWriteLogRecord; } /** * @deprecated - please use {@link ReadWriteLogRecord} instead. */ export type SdkLogRecord = ReadWriteLogRecord; //# sourceMappingURL=ReadWriteLogRecord.d.ts.map