Skip to content

Loggical API Documentation v1.0.1


Loggical API Documentation / BaseTransport

Abstract Class: BaseTransport

Defined in: transports/transport.interface.ts:17

Base transport class with common functionality

Extended by

Implements

Constructors

Constructor

ts
new BaseTransport(options: TransportOptions): BaseTransport;

Defined in: transports/transport.interface.ts:21

Parameters

ParameterType
optionsTransportOptions

Returns

BaseTransport

Properties

name

ts
abstract readonly name: string;

Defined in: transports/transport.interface.ts:18

Unique name for this transport (for debugging/identification)

Implementation of

Transport.name


options

ts
protected options: TransportOptions;

Defined in: transports/transport.interface.ts:19

Methods

shouldWrite()

ts
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

ParameterType
levelLogLevelType
messagestring
metadataLogMetadata

Returns

boolean


safeWrite()

ts
safeWrite(formattedMessage: string, metadata: LogMetadata): Promise<void>;

Defined in: transports/transport.interface.ts:52

Write with filtering and error handling

Parameters

ParameterType
formattedMessagestring
metadataLogMetadata

Returns

Promise<void>


write()

ts
abstract write(formattedMessage: string, metadata: LogMetadata): void | Promise<void>;

Defined in: transports/transport.interface.ts:66

Write a formatted log message to this transport

Parameters

ParameterTypeDescription
formattedMessagestringThe complete formatted log message
metadataLogMetadataAdditional metadata about the log entry

Returns

void | Promise<void>

Implementation of

Transport.write


configure()

ts
configure(options: Record<string, unknown>): void;

Defined in: transports/transport.interface.ts:71

Configure or reconfigure this transport

Parameters

ParameterTypeDescription
optionsRecord<string, unknown>Transport-specific configuration options

Returns

void

Implementation of

Transport.configure


getStatus()

ts
getStatus(): Record<string, unknown>;

Defined in: transports/transport.interface.ts:75

Get current configuration/status of this transport Useful for debugging and monitoring

Returns

Record<string, unknown>

Implementation of

Transport.getStatus

Released under the MIT License.