import pino from 'pino';

const prettyPrint = process.env.NODE_ENV !== 'production';
const enabled = !process.argv.includes('--silent');

const reqSerializerDev = req => `${req.method.toUpperCase()} ${req.url.href}`;
const resSerializerDev = res => res.statusCode;

const pretty = pino.pretty({
	forceColor: true,
	messageKey: 'message', // Stackdriver uses this key for log summary
});
pretty.pipe(process.stdout);
const logger = pino(
	{
		timestamp: prettyPrint, // prod logs provide their own timestamp
		messageKey: 'message', // Stackdriver uses this key for log summary
		enabled,
		serializers: {
			req: prettyPrint ? reqSerializerDev : pino.stdSerializers.req,
			res: prettyPrint ? resSerializerDev : pino.stdSerializers.res,
		},
	},
	prettyPrint ? pretty : process.stdout
);

export default logger;

@@ -98,17 +98,16 @@
 d = 
-!
 process.
 argv
@@ -106,34 +106,66 @@
 ess.
-argv.includes('--silent');
+env.NODE_ENV !== 'test'; // don't print when running tests
 %0A%0Aco
@@ -411,16 +411,17 @@
 ary%0A%7D);%0A
+%0A
 pretty.p
@@ -441,16 +441,17 @@
 tdout);%0A
+%0A
 const lo

fix pino enabled flag