Download wp-calypso/client/server/lib/logger/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 428 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/server/lib/logger/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/server/lib/logger/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/server/lib/logger/index.js
428 Bytes
| import bunyan from 'bunyan'; | |
| let logger; | |
| const createLogger = () => { | |
| logger = bunyan.createLogger( { | |
| name: 'calypso', | |
| streams: [ | |
| { | |
| stream: process.stdout, | |
| level: 'info', | |
| }, | |
| ], | |
| } ); | |
| if ( process.env.CALYPSO_LOGFILE ) { | |
| logger.addStream( { | |
| path: process.env.CALYPSO_LOGFILE, | |
| level: 'info', | |
| } ); | |
| } | |
| }; | |
| export const getLogger = () => { | |
| if ( ! logger ) { | |
| createLogger(); | |
| } | |
| return logger; | |
| }; | |