From 7c43e9509ae50f46c4d60c228d8a9d7317bf204c Mon Sep 17 00:00:00 2001 From: Antony Date: Fri, 26 May 2023 11:32:37 +0530 Subject: [PATCH] Enable logs condition improvement --- src/filesystem.ts | 7 ++++++- src/index.ts | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/filesystem.ts b/src/filesystem.ts index e753e00..503e132 100644 --- a/src/filesystem.ts +++ b/src/filesystem.ts @@ -31,7 +31,12 @@ import { } from './utils' const debug = Debug('asset-store-filesystem') -if (process.env.DEBUG === "*") debug.enabled = true; +if ( + process.env.DEBUG === "*" || + (process.env.DEBUG || "").includes("asset-store-filesystem") +) { + debug.enabled = true; +} interface IAsset { locale: string, diff --git a/src/index.ts b/src/index.ts index ab3d389..881bfaf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -110,7 +110,12 @@ export const getConfig = () => { export { assetStoreInstance } const debug = Debug('asset-store-filesystem') -if (process.env.DEBUG === '*') debug.enabled = true; +if ( + process.env.DEBUG === "*" || + (process.env.DEBUG || "").includes("asset-store-filesystem") +) { + debug.enabled = true; +} /** * @description to start the asset connector