analogger 1.36.0 → 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/package.json +1 -1
- package/src/ana-logger.cjs +1 -0
package/README.md
CHANGED
|
@@ -704,6 +704,12 @@ const LOG_TARGETS = ["GROUP1", "GROUP2", "TOM", "TIM"/*, "ALL", "USER"*/];
|
|
|
704
704
|
// Contexts define how the log should be seen
|
|
705
705
|
const LOG_CONTEXTS = {STANDARD: null, TEST: {color: "#B18904", symbol: "⏰"}, C1: null, C2: null, C3: null, DEFAULT: {}}
|
|
706
706
|
|
|
707
|
+
// Important. Set the default behaviour.
|
|
708
|
+
// By default, no log will be displayed when the target is missing from `anaLogger.log`
|
|
709
|
+
anaLogger.setDefaultContext({
|
|
710
|
+
target: DEFAULT_LOG_TARGETS.NONE // or "NONE" (value can be "ALL", "NONE", "USER")
|
|
711
|
+
})
|
|
712
|
+
|
|
707
713
|
// LOG_CONTEXTS will be modified by setContexts
|
|
708
714
|
anaLogger.setContexts(LOG_CONTEXTS);
|
|
709
715
|
|
|
@@ -726,7 +732,7 @@ anaLogger.log({target: "TOM"}, `You will see this`);
|
|
|
726
732
|
anaLogger.log({target: "TIM"}, `You will not see this`);
|
|
727
733
|
anaLogger.log({target: "GROUP1"}, `You will see this`);
|
|
728
734
|
|
|
729
|
-
//
|
|
735
|
+
// By default, the system will not display logs for non-targeted users (@see setDefaultContext above)
|
|
730
736
|
anaLogger.setActiveTarget("NonDefinedTarget");
|
|
731
737
|
anaLogger.log({lid: "WEB35388"}, `You will not see this`);
|
|
732
738
|
anaLogger.log({lid: "WEB35388", target: "NonDefinedTarget"}, `You will not see this`);
|
package/package.json
CHANGED