Loggical API Documentation v1.0.1
Loggical API Documentation / ConsoleTransport
Class: ConsoleTransport
Defined in: transports/console-transport.ts:15
Transport that outputs logs to the console This is the default transport that maintains existing behavior
Extends
Constructors
Constructor
new ConsoleTransport(options: ConsoleTransportOptions): ConsoleTransport;Defined in: transports/console-transport.ts:21
Parameters
| Parameter | Type |
|---|---|
options | ConsoleTransportOptions |
Returns
ConsoleTransport
Overrides
Properties
name
readonly name: "console" = 'console';Defined in: transports/console-transport.ts:16
Unique name for this transport (for debugging/identification)
Overrides
options
protected options: TransportOptions;Defined in: transports/transport.interface.ts:19
Inherited from
Methods
write()
write(formattedMessage: string, metadata: LogMetadata): void;Defined in: transports/console-transport.ts:27
Write a formatted log message to this transport
Parameters
| Parameter | Type | Description |
|---|---|---|
formattedMessage | string | The complete formatted log message |
metadata | LogMetadata | Additional metadata about the log entry |
Returns
void
Overrides
configure()
configure(options: Record<string, unknown>): void;Defined in: transports/console-transport.ts:54
Configure or reconfigure this transport
Parameters
| Parameter | Type | Description |
|---|---|---|
options | Record<string, unknown> | Transport-specific configuration options |
Returns
void
Overrides
getStatus()
getStatus(): Record<string, unknown>;Defined in: transports/console-transport.ts:70
Get current configuration/status of this transport Useful for debugging and monitoring
Returns
Record<string, unknown>
Overrides
shouldWrite()
protected shouldWrite(
level: LogLevelType,
message: string,
metadata: LogMetadata): boolean;Defined in: transports/transport.interface.ts:31
Check if this message should be processed by this transport
Parameters
| Parameter | Type |
|---|---|
level | LogLevelType |
message | string |
metadata | LogMetadata |
Returns
boolean
Inherited from
safeWrite()
safeWrite(formattedMessage: string, metadata: LogMetadata): Promise<void>;Defined in: transports/transport.interface.ts:52
Write with filtering and error handling
Parameters
| Parameter | Type |
|---|---|
formattedMessage | string |
metadata | LogMetadata |
Returns
Promise<void>
