How to use the @financial-times/n-logger.warn function in @financial-times/n-logger

To help you get started, we’ve selected a few @financial-times/n-logger examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Financial-Times / n-auto-logger / src / __tests__ / failure-logger.js View on Github external
it('null or undefined input', async () => {
			const context = {
				operation: 'someOperation',
				action: 'someAction',
			};
			await failureLogger(context)();
			expect(logger.warn.mock.calls).toHaveLength(1);
			expect(logger.warn.mock.calls[0][0]).toMatchSnapshot();
		});
github Financial-Times / n-auto-logger / src / __tests__ / failure-logger.js View on Github external
const extendedSystemError = nError({
				status: 500,
				message: 'some error message',
			});
			await failureLogger()(extendedSystemError);
			expect(logger.error.mock.calls).toHaveLength(1);
			assertErrorLog(logger.error.mock.calls[0][0]);

			const extendedSystemError404 = nError({
				status: 404,
				message: 'some error message',
			});
			await failureLogger()(extendedSystemError404);
			expect(logger.error.mock.calls).toHaveLength(1);
			expect(logger.warn.mock.calls).toHaveLength(1);
			assertErrorLog(logger.warn.mock.calls[0][0]);
		});

@financial-times/n-logger

This package provides a Winston wrapper which sends server-side logs to Splunk's HTTP Event Collector (HEC).

MIT
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis

Popular @financial-times/n-logger functions

Similar packages