diff --git a/README.md b/README.md index ebd6d68..80f61d4 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,7 @@ You may also set the log level via the `LOG_LEVEL` environment variable. However Every call to `debino` creates a child logger based on a root logger. The default root logger is an instance returned by `pino()`, without any options. You may set your own root logger by calling `setRootLogger()`: ```js -import pino from 'pino'; -import debino, { setRootLogger } from '@uphold/debino'; +import debino, { setRootLogger, pino } from '@uphold/debino'; // Call this as soon as possible in your application. setRootLogger(pino({ redact: ['foo'] })); diff --git a/src/index.js b/src/index.js index 23202dd..6681e83 100644 --- a/src/index.js +++ b/src/index.js @@ -84,4 +84,5 @@ setRootLogger(pino()); */ module.exports = debino; +module.exports.pino = pino; module.exports.setRootLogger = setRootLogger; diff --git a/types/index.d.ts b/types/index.d.ts index 2e41192..2b3ccd8 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,7 +1,8 @@ -import { Logger, ChildLoggerOptions } from "pino"; - -export function setRootLogger(logger: Logger) +import { Logger, ChildLoggerOptions, pino } from "pino"; declare function debino(namespace: string, options?: { prefix?: string, suffix?: string } & ChildLoggerOptions): Logger +declare function setRootLogger(logger: Logger) + export default debino; +export { setRootLogger, pino }