Skip to content

Commit

Permalink
Formatting+pino
Browse files Browse the repository at this point in the history
  • Loading branch information
jahpola committed Sep 4, 2023
1 parent c21da59 commit 72f01e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/gcpLogging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export type GcpLogSeverity =
| "EMERGENCY";

export const changePinoLevelToGcpLogSeverity = (
level: pino.LevelWithSilent,
level: pino.LevelWithSilent
): GcpLogSeverity => {
switch (level) {
case "trace":
Expand Down Expand Up @@ -68,7 +68,7 @@ export const changePinoLevelToGcpLogSeverity = (
*/
export const createLogger = <Options extends pino.LoggerOptions>(
options: Options & { name: string },
stream?: pino.DestinationStream,
stream?: pino.DestinationStream
): pino.Logger<Options> =>
pino(
{
Expand Down Expand Up @@ -99,7 +99,7 @@ export const createLogger = <Options extends pino.LoggerOptions>(
};
},
log(
object: Record<string, unknown> & { err?: Error },
object: Record<string, unknown> & { err?: Error }
): Record<string, unknown> {
const stackTrace = object.err?.stack;
const stackProperty = stackTrace ? { stack_trace: stackTrace } : {};
Expand All @@ -113,5 +113,5 @@ export const createLogger = <Options extends pino.LoggerOptions>(
// add it separately.
...options,
},
stream ?? pino.destination({ sync: true }),
stream ?? pino.destination({ sync: true })
);
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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<void>;
let client: Pulsar.Client;
Expand Down

0 comments on commit 72f01e7

Please sign in to comment.