@clickup/ent-framework
Version:
A PostgreSQL graph-database-alike library with microsharding and row-level security
31 lines (21 loc) • 1.87 kB
Markdown
[**/ent-framework**](../README.md)
***
[/ent-framework](../globals.md) / Loggers
# Interface: Loggers\<TNode\>
Defined in: [src/abstract/Loggers.ts:11](https://github.com/clickup/ent-framework/blob/master/src/abstract/Loggers.ts#L11)
Loggers are called at different stages of the query lifecycle. We do not use
EventEmitter for several reasons:
1. It is not friendly to mocking in Jest.
2. The built-in EventEmitter is not strongly typed.
## Type Parameters
| Type Parameter | Default type |
| ------ | ------ |
| `TNode` | `DesperateAny` |
## Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="clientquerylogger"></a> `clientQueryLogger?` | (`props`: [`ClientQueryLoggerProps`](ClientQueryLoggerProps.md)) => `void` | Logs actual queries to the database (after batching). |
| <a id="swallowederrorlogger"></a> `swallowedErrorLogger` | (`props`: [`SwallowedErrorLoggerProps`](SwallowedErrorLoggerProps.md)) => `void` | Logs errors which did not throw through (typically recoverable). |
| <a id="runonsharderrorlogger"></a> `runOnShardErrorLogger?` | (`props`: [`RunOnShardErrorLoggerProps`](RunOnShardErrorLoggerProps.md)) => `void` | Called when Island-from-Shard location fails (e.g. no such Shard), or when a query on a particular Shard fails due to any reason (like transport error). Mostly used in unit tests, since it's called for every retry. |
| <a id="clientendlogger"></a> `clientEndLogger?` | (`props`: [`ClientEndLoggerProps`](ClientEndLoggerProps.md)\<`TNode`\>) => `void` | Called when a Client gets ended due to dynamic Islands reconfiguration. Allows to debug flaky Island reconfiguration. |
| <a id="clientconnectedlogger"></a> `clientConnectedLogger?` | (`props`: [`ClientConnectedLoggerProps`](ClientConnectedLoggerProps.md)\<`TNode`\>) => `void` | Called when a Client connects to the database. |