Download 009-localization-engineer/workspace/t1/LibreChat/api/utils/logger.js from Continual-Learning-Exam/CLE-Lite-Workspaces: direct link, hf CLI and curl.
- Browser
- Download file 506 Bytes
-
https://huggingface.co/datasets/Continual-Learning-Exam/CLE-Lite-Workspaces/resolve/main/009-localization-engineer/workspace/t1/LibreChat/api/utils/logger.js
- Command line
-
hf download hf://datasets/Continual-Learning-Exam/CLE-Lite-Workspaces/009-localization-engineer/workspace/t1/LibreChat/api/utils/logger.js
-
curl -L -o logger.js https://huggingface.co/datasets/Continual-Learning-Exam/CLE-Lite-Workspaces/resolve/main/009-localization-engineer/workspace/t1/LibreChat/api/utils/logger.js
506 Bytes
| const winston = require('winston'); | |
| const useFileLogging = | |
| typeof process.env.LOG_TO_FILE !== 'string' || process.env.LOG_TO_FILE.toLowerCase() !== 'false'; | |
| const transports = [new winston.transports.Console()]; | |
| if (useFileLogging) { | |
| transports.push(new winston.transports.File({ filename: 'login-logs.log' })); | |
| } | |
| const logger = winston.createLogger({ | |
| level: 'info', | |
| format: winston.format.combine(winston.format.timestamp(), winston.format.json()), | |
| transports, | |
| }); | |
| module.exports = logger; | |