From e3998816e20510c689a414f0f42c25751252dad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 29 Jun 2020 15:41:31 +0300 Subject: [PATCH] Add TypeScript example --- readme.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/readme.md b/readme.md index a4ed88e..1d5413e 100644 --- a/readme.md +++ b/readme.md @@ -42,6 +42,22 @@ var logger = winston.createLogger({ }); ``` +or in TypeScript: + +```typescript +import { createLogger } from 'winston'; +import * as WinstonGraylog2 from 'winston-graylog2'; + +const options = { ...... }; +const logger = createLogger({ + transports: [ + new WinstonGraylog2(options), + ], +}); + +logger.info(`tere`); +``` + ## Options * __name__: Transport name