Loading...
Skip to main content

Class: LogImplementation

core/log.LogImplementation

An abstract class that represents an implementation of Logger.

Hierarchy

Constructors

constructor

new LogImplementation()

Properties

loggedExceptions

Protected Readonly loggedExceptions: WeakMap<object, boolean>

Defined in

ai-jsx/src/core/log.ts:26

Methods

log

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

Parameters

NameTypeDescription
levelLogLevelThe logging level.
elementElement<any>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

Defined in

ai-jsx/src/core/log.ts:35


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

Defined in

ai-jsx/src/core/log.ts:52


setAttribute

setAttribute(_element, _renderId, _key, _value): void

Sets an attribute to be associated with the rendering of a particular element.

Parameters

NameType
_elementElement<any>
_renderIdstring
_keystring
_valuestring

Returns

void

Defined in

ai-jsx/src/core/log.ts:74