Skip to main content

Class: PinoLogger

core/log.PinoLogger

An implementation of LogImplementation that uses the pino logging library.

Hierarchy

Constructors

constructor

new PinoLogger(pino?)

Parameters

NameType
pinoLogger<LoggerOptions>

Overrides

LogImplementation.constructor

Defined in

packages/ai-jsx/src/core/log.ts:86

Properties

loggedExceptions

Protected Readonly loggedExceptions: WeakMap<object, boolean>

Inherited from

LogImplementation.loggedExceptions

Defined in

packages/ai-jsx/src/core/log.ts:22

Methods

log

log(level, element, renderId, metadataOrMessage, message?): void

Parameters

NameTypeDescription
levelLogLevelThe logging level.
elementElement<object>The element from which the log originated.
renderIdstringA unique identifier associated with the rendering request for this element.
metadataOrMessagestring | objectAn object to be included in the log, or a message to log.
message?stringThe message to log, if metadataOrMessage is an object.

Returns

void

Overrides

LogImplementation.log

Defined in

packages/ai-jsx/src/core/log.ts:90


logException

logException(element, renderId, exception): void

Logs exceptions thrown during an element's render. By default invokes log with level "error" for the element that threw the exception and level "trace" for elements through which the exception propagated. This will not be invoked for ErrorBoundary components that handle errors from their children.

Parameters

NameTypeDescription
elementElement<object>The element from which the exception originated or through which the exception was propagated.
renderIdstringA unique identifier associated with the rendering request for this element.
exceptionunknownThe thrown exception.

Returns

void

Inherited from

LogImplementation.logException

Defined in

packages/ai-jsx/src/core/log.ts:48