mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-10 00:08:22 +03:00
fix: use environment for log level, again
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import CreateLogCtx, { ChangeRootLogLevel, GetLogLevel, rootLogger, Transports } from "./logger";
|
||||
import { ServerConfig } from "lib/setup/config";
|
||||
import { Environment, ServerConfig } from "lib/setup/config";
|
||||
import t from "tap";
|
||||
|
||||
const LOG_LEVEL = ServerConfig.LOGGER_CONFIG.LOG_LEVEL;
|
||||
const LOG_LEVEL = Environment.logLevel;
|
||||
|
||||
t.test("Logger Tests", (t) => {
|
||||
const logger = CreateLogCtx(__filename);
|
||||
|
||||
@@ -323,4 +323,5 @@ export const Environment = {
|
||||
commitHash: process.env.COMMIT_HASH,
|
||||
seqUrl: process.env.SEQ_URL,
|
||||
seqApiKey: process.env.SEQ_API_KEY,
|
||||
logLevel: logLevel as "crit" | "debug" | "error" | "info" | "severe" | "verbose" | "warn",
|
||||
};
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ const logger = CreateLogCtx(__filename);
|
||||
logger.info(`Booting ${TachiConfig.NAME} - ${VERSION_PRETTY} [ENV: ${Environment.nodeEnv}]`, {
|
||||
bootInfo: true,
|
||||
});
|
||||
logger.info(`Log level is set to ${ServerConfig.LOGGER_CONFIG.LOG_LEVEL}.`, { bootInfo: true });
|
||||
logger.info(`Log level is set to ${Environment.logLevel}.`, { bootInfo: true });
|
||||
|
||||
logger.info(`Loading sequence documents...`, { bootInfo: true });
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import deepmerge from "deepmerge";
|
||||
import db from "external/mongo/db";
|
||||
import { ONE_MINUTE } from "lib/constants/time";
|
||||
import { ChangeRootLogLevel, GetLogLevel } from "lib/logger/logger";
|
||||
import { ServerConfig } from "lib/setup/config";
|
||||
import { Environment, ServerConfig } from "lib/setup/config";
|
||||
import { UserAuthLevels } from "tachi-common";
|
||||
import t from "tap";
|
||||
import { CreateFakeAuthCookie } from "test-utils/fake-auth";
|
||||
@@ -12,7 +12,7 @@ import { TestingIIDXSPScore } from "test-utils/test-data";
|
||||
import { Sleep } from "utils/misc";
|
||||
import type { ScoreDocument } from "tachi-common";
|
||||
|
||||
const LOG_LEVEL = ServerConfig.LOGGER_CONFIG.LOG_LEVEL;
|
||||
const LOG_LEVEL = Environment.logLevel;
|
||||
|
||||
t.test("POST /api/v1/admin/change-log-level", async (t) => {
|
||||
t.beforeEach(async () => {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { SendSiteAnnouncementNotification } from "lib/notifications/notification
|
||||
import { UpdateGoalsForUser } from "lib/score-import/framework/goals/goals";
|
||||
import { UpdateQuestsForUser } from "lib/score-import/framework/quests/quests";
|
||||
import { DeleteMultipleScores, DeleteScore } from "lib/score-mutation/delete-scores";
|
||||
import { ServerConfig, TachiConfig } from "lib/setup/config";
|
||||
import { Environment, ServerConfig, TachiConfig } from "lib/setup/config";
|
||||
import { p } from "prudence";
|
||||
import prValidate from "server/middleware/prudence-validate";
|
||||
import { UserAuthLevels } from "tachi-common";
|
||||
@@ -56,7 +56,7 @@ const RequireAdminLevel: RequestHandler = async (req, res, next) => {
|
||||
next();
|
||||
};
|
||||
|
||||
const LOG_LEVEL = ServerConfig.LOGGER_CONFIG.LOG_LEVEL;
|
||||
const LOG_LEVEL = Environment.logLevel;
|
||||
|
||||
router.use(RequireAdminLevel);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user