This commit replaces the use of Logger with getLogger in various parts of the code to handle logging. The Logger has been replaced with getLogger, which assists in getting logs in an asynchronous manner. In addition to this, it updates the next version in pnpm-lock.yaml from next@14.2.0-canary.61 to next@14.2.0-canary.62 and various other dependencies. Also made minor annotations and comments to the function 'isBrowser' and 'formatCurrency' in the 'utils.ts' file.
24 lines
560 B
TypeScript
24 lines
560 B
TypeScript
import { Logger as LoggerInstance } from './logger';
|
|
|
|
const LOGGER = process.env.LOGGER ?? 'pino';
|
|
|
|
/*
|
|
* Logger
|
|
* By default, the logger is set to use Pino. To change the logger, update the import statement below.
|
|
* to your desired logger implementation.
|
|
*/
|
|
async function getLogger(): Promise<LoggerInstance> {
|
|
switch (LOGGER) {
|
|
case 'pino': {
|
|
const { Logger: PinoLogger } = await import('./impl/pino');
|
|
|
|
return PinoLogger;
|
|
}
|
|
|
|
default:
|
|
throw new Error(`Unknown logger: ${process.env.LOGGER}`);
|
|
}
|
|
}
|
|
|
|
export { getLogger };
|