feat(logging): add opt-in debug logging mode
- Add validated LOG_MODE configuration and route trace-aware diagnostics through debug. - Select debug mode in shared test setup while preserving DEBUG namespace control. - Add logger/config regression coverage and document runtime configuration.
This commit is contained in:
1 parent
ff9a700c86
commit
ceed27ad9e
10 files changed
+214
-4
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import "reflect-metadata";
|
||||
import { validateAppConfig } from "../src/config/app.config";
|
||||
import { LogMode, validateAppConfig } from "../src/config/app.config";
|
||||
import { durationSeconds } from "../src/common/interval";
|
||||
|
||||
describe("Authentication configuration", () => {
|
||||
@@ -12,6 +12,17 @@ describe("Authentication configuration", () => {
|
||||
expect(config.AUTH_REVOKED_TOKEN_CLEANUP_CRON).toBe("0 3 * * *");
|
||||
});
|
||||
|
||||
it("defaults to console logging and accepts debug logging", () => {
|
||||
expect(validateAppConfig({}).LOG_MODE).toBe(LogMode.Console);
|
||||
expect(validateAppConfig({ LOG_MODE: "debug" }).LOG_MODE).toBe(
|
||||
LogMode.Debug,
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects unsupported logging modes", () => {
|
||||
expect(() => validateAppConfig({ LOG_MODE: "silent" })).toThrow();
|
||||
});
|
||||
|
||||
it("parses explicit true and false values without JavaScript truthiness", () => {
|
||||
expect(validateAppConfig({ AUTH_ENABLED: "false" }).AUTH_ENABLED).toBe(
|
||||
false,
|
||||
|
||||
Reference in new issue
Block a user