Class: CombinedLogger
core/log.CombinedLogger
An implementation of LogImplementation that logs to multiple underlying LogImplementations.
Hierarchy
↳
CombinedLogger
Constructors
constructor
• new CombinedLogger(loggers
)
Parameters
Name | Type |
---|---|
loggers | LogImplementation [] |
Overrides
Defined in
packages/ai-jsx/src/core/log.ts:154
Properties
loggedExceptions
• Protected
Readonly
loggedExceptions: WeakMap
<object
, boolean
>
Inherited from
LogImplementation.loggedExceptions
Defined in
packages/ai-jsx/src/core/log.ts:26
Methods
log
▸ log(level
, element
, renderId
, metadataOrMessage
, message?
): void
Parameters
Name | Type | Description |
---|---|---|
level | LogLevel | The logging level. |
element | Element <any > | The element from which the log originated. |
renderId | string | A unique identifier associated with the rendering request for this element. |
metadataOrMessage | string | object | An object to be included in the log, or a message to log. |
message? | string | The message to log, if metadataOrMessage is an object. |
Returns
void
Overrides
Defined in
packages/ai-jsx/src/core/log.ts:158
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
Name | Type | Description |
---|---|---|
element | Element <object > | The element from which the exception originated or through which the exception was propagated. |
renderId | string | A unique identifier associated with the rendering request for this element. |
exception | unknown | The thrown exception. |
Returns
void
Overrides
LogImplementation.logException
Defined in
packages/ai-jsx/src/core/log.ts:168
setAttribute
▸ setAttribute(element
, renderId
, key
, value
): void
Sets an attribute to be associated with the rendering of a particular element.
Parameters
Name | Type |
---|---|
element | Element <any > |
renderId | string |
key | string |
value | string |
Returns
void
Overrides
LogImplementation.setAttribute