mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
🔄 refactor: Consolidate Ask/Edit Controllers (#1365)
* refactor(Ask/Edit): consolidate ask/edit controllers between the main modules and openAI controllers to reduce repetition of code and increase reusability * fix(winston/logger): circular dependency issue * fix(config/scripts): fix script imports * refactor(indexSync): make not configured message an info log message * chore: create a rollup script for api/server/index.js to check circular dependencies * chore: bump @keyv/redis
This commit is contained in:
parent
0958db3825
commit
509b1e5c63
20 changed files with 299 additions and 368 deletions
|
|
@ -2,7 +2,6 @@ const path = require('path');
|
|||
const winston = require('winston');
|
||||
require('winston-daily-rotate-file');
|
||||
const { redact, deepObjectFormat } = require('./parsers');
|
||||
const { isEnabled } = require('~/server/utils/handleText');
|
||||
|
||||
const logDir = path.join(__dirname, '..', 'logs');
|
||||
|
||||
|
|
@ -67,7 +66,10 @@ const transports = [
|
|||
// );
|
||||
// }
|
||||
|
||||
if (isEnabled && isEnabled(DEBUG_LOGGING)) {
|
||||
if (
|
||||
(typeof DEBUG_LOGGING === 'string' && DEBUG_LOGGING?.toLowerCase() === 'true') ||
|
||||
DEBUG_LOGGING === true
|
||||
) {
|
||||
transports.push(
|
||||
new winston.transports.DailyRotateFile({
|
||||
level: 'debug',
|
||||
|
|
@ -88,7 +90,10 @@ const consoleFormat = winston.format.combine(
|
|||
winston.format.printf((info) => `${info.timestamp} ${info.level}: ${info.message}`),
|
||||
);
|
||||
|
||||
if (isEnabled && isEnabled(DEBUG_CONSOLE)) {
|
||||
if (
|
||||
(typeof DEBUG_CONSOLE === 'string' && DEBUG_CONSOLE?.toLowerCase() === 'true') ||
|
||||
DEBUG_CONSOLE === true
|
||||
) {
|
||||
transports.push(
|
||||
new winston.transports.Console({
|
||||
level: 'debug',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue