UNPKG

nodejs-gcp-log-correlation

Version:

A Node.js package for automatic log correlation in Google Cloud Platform using trace context

16 lines (11 loc) 641 B
import { Request, Response, NextFunction } from 'express'; interface WrappedLogger { info: (message: string, meta?: Record<string, any>) => void; warn: (message: string, meta?: Record<string, any>) => void; error: (message: string, meta?: Record<string, any>) => void; debug: (message: string, meta?: Record<string, any>) => void; } declare const proxyLogger: WrappedLogger; declare function loggerMiddleware(): (req: Request, _: Response, next: NextFunction) => void; declare function wrapCloudFunction<T extends (...args: any[]) => any>(fn: T): T; export { proxyLogger as logger, loggerMiddleware, wrapCloudFunction };