UNPKG

@connektra/logger-service

Version:

A logger service that sends logs to Google Cloud Tasks

46 lines (45 loc) 1.07 kB
export interface LoggerConfig { projectId: string; location: string; queueName: string; serviceAccountEmail?: string; serviceUrl: string; retryConfig?: RetryConfig; fallbackStrategy?: FallbackStrategy; } export interface RetryConfig { maxRetries: number; initialDelayMs: number; maxDelayMs: number; backoffFactor: number; enableJitter?: boolean; } export declare enum FallbackStrategy { LOCAL_ONLY = "local_only", BUFFER_AND_FLUSH = "buffer_and_flush", DISCARD = "discard" } export declare enum LogType { INFO = "info", ERROR = "error", EXECUTION = "execution" } export interface LogPayload { type: LogType; log: any; message?: string; timestamp?: string; source?: string; } export interface LogBasePayload { log: any; message?: string; source?: string; } interface Logger { info: (payload: LogBasePayload) => void; error: (payload: LogBasePayload) => void; executionLog: (payload: LogBasePayload) => void; } declare const log: Logger; export default log;