@lidofinance/api-logger
v0.46.0
Published
API logger, which hides secrets
Downloads
132
Readme
@lidofinance/api-logger
API logger, which hides secrets
Installation
yarn add @lidofinance/api-logger
Getting started
You just need to initialize it with secrets you want to hide, usually it's all secrets from serverRuntimeConfig
for
next.js, after that, you are free to use it as regular console.log
.
import getConfig from 'next/config';
import { serverLoggerFactory } from '@lidofinance/api-logger';
const { serverRuntimeConfig } = getConfig();
const {
infuraApiKey,
alchemyApiKey,
subgraphMainnet,
subgraphGoerli,
} = serverRuntimeConfig;
export const serverLogger = serverLoggerFactory([
infuraApiKey,
alchemyApiKey,
subgraphMainnet,
subgraphGoerli,
]);
serverLogger.log('Something common')
serverLogger.error(new Error('Some error'))