From 72f01e707857b6d7df31aaf4a27dcb5fa8fba4f8 Mon Sep 17 00:00:00 2001 From: Jyrki Ahpola Date: Mon, 4 Sep 2023 10:33:06 +0300 Subject: [PATCH] Formatting+pino --- src/gcpLogging.ts | 8 ++++---- src/index.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gcpLogging.ts b/src/gcpLogging.ts index 34501d17..876232eb 100644 --- a/src/gcpLogging.ts +++ b/src/gcpLogging.ts @@ -35,7 +35,7 @@ export type GcpLogSeverity = | "EMERGENCY"; export const changePinoLevelToGcpLogSeverity = ( - level: pino.LevelWithSilent, + level: pino.LevelWithSilent ): GcpLogSeverity => { switch (level) { case "trace": @@ -68,7 +68,7 @@ export const changePinoLevelToGcpLogSeverity = ( */ export const createLogger = ( options: Options & { name: string }, - stream?: pino.DestinationStream, + stream?: pino.DestinationStream ): pino.Logger => pino( { @@ -99,7 +99,7 @@ export const createLogger = ( }; }, log( - object: Record & { err?: Error }, + object: Record & { err?: Error } ): Record { const stackTrace = object.err?.stack; const stackProperty = stackTrace ? { stack_trace: stackTrace } : {}; @@ -113,5 +113,5 @@ export const createLogger = ( // add it separately. ...options, }, - stream ?? pino.destination({ sync: true }), + stream ?? pino.destination({ sync: true }) ); diff --git a/src/index.ts b/src/index.ts index dce2bd80..83b064cc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -import pino from "pino"; +import type pino from "pino"; import type Pulsar from "pulsar-client"; import { getConfig } from "./config"; import createHealthCheckServer from "./healthCheck"; @@ -111,7 +111,7 @@ const exitGracefully = async ( const serviceName = "waltti-apc-journey-matcher"; try { const logger = createLogger({ name: serviceName }); - + let setHealthOk: (isOk: boolean) => void; let closeHealthCheckServer: () => Promise; let client: Pulsar.Client;