@applitools/logger
Advanced tools
+10
-0
| # Changelog | ||
| ## [2.2.13](https://github.com/Applitools-Dev/sdk/compare/js/logger@2.2.12...js/logger@2.2.13) (2026-06-18) | ||
| ### Dependencies | ||
| * @applitools/utils bumped to 1.15.0 | ||
| #### Features | ||
| * one-time per-execution summary logEvent in storybook | AD-14305 ([#3911](https://github.com/Applitools-Dev/sdk/issues/3911)) ([59e3a5d](https://github.com/Applitools-Dev/sdk/commit/59e3a5dccf74aa1ac1158024316bd305e3515afa)) | ||
| ## [2.2.12](https://github.com/Applitools-Dev/sdk/compare/js/logger@2.2.11...js/logger@2.2.12) (2026-05-26) | ||
@@ -4,0 +14,0 @@ |
+43
-1
| "use strict"; | ||
| var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| var desc = Object.getOwnPropertyDescriptor(m, k); | ||
| if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
| desc = { enumerable: true, get: function() { return m[k]; } }; | ||
| } | ||
| Object.defineProperty(o, k2, desc); | ||
| }) : (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| o[k2] = m[k]; | ||
| })); | ||
| var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
| Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
| }) : function(o, v) { | ||
| o["default"] = v; | ||
| }); | ||
| var __importStar = (this && this.__importStar) || function (mod) { | ||
| if (mod && mod.__esModule) return mod; | ||
| var result = {}; | ||
| if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
| __setModuleDefault(result, mod); | ||
| return result; | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.makeSpyLogger = void 0; | ||
| /* eslint no-console: off */ | ||
| const logger_1 = require("./logger"); | ||
| const utils = __importStar(require("@applitools/utils")); | ||
| // @ts-ignore | ||
| const promises_1 = require("node:timers/promises"); | ||
| function makeSpyLogger({ level } = {}) { | ||
| function makeSpyLogger({ level, label } = {}) { | ||
| const calls = []; | ||
| const waiter = makeWaiter(); | ||
| let loggerExtension = undefined; | ||
| // When SHOW_SPY_LOGS (APPLITOOLS_SHOW_SPY_LOGS) is enabled, mirror captured calls to the | ||
| // console so developers can see what the SDK is doing while spy assertions still work. | ||
| // Pure spies otherwise produce zero visible output, which makes debugging hangs and | ||
| // failures slow. A dedicated env var (rather than reusing APPLITOOLS_SHOW_LOGS) keeps | ||
| // this opt-in for spec-debugging without also flipping every real logger in the process | ||
| // to verbose mode. Suppressed when CI is set: the visibility is a local-dev aid, and | ||
| // mirroring in CI just pollutes build logs without helping anyone. | ||
| const mirrorToConsole = utils.general.getEnvValue('SHOW_SPY_LOGS', 'boolean') && !process.env.CI; | ||
| const prefix = label ? `[spy:${label}]` : '[spy]'; | ||
| const logger = (0, logger_1.makeLogger)({ | ||
@@ -16,2 +50,4 @@ handler: { | ||
| loggerExtension === null || loggerExtension === void 0 ? void 0 : loggerExtension.log(message); | ||
| if (mirrorToConsole) | ||
| console.log(`${prefix} [INFO ] ${message}`); | ||
| waiter.notifyAll(); | ||
@@ -22,2 +58,4 @@ }, | ||
| loggerExtension === null || loggerExtension === void 0 ? void 0 : loggerExtension.error(message); | ||
| if (mirrorToConsole) | ||
| console.error(`${prefix} [ERROR] ${message}`); | ||
| waiter.notifyAll(); | ||
@@ -28,2 +66,4 @@ }, | ||
| loggerExtension === null || loggerExtension === void 0 ? void 0 : loggerExtension.warn(message); | ||
| if (mirrorToConsole) | ||
| console.warn(`${prefix} [WARN ] ${message}`); | ||
| waiter.notifyAll(); | ||
@@ -34,2 +74,4 @@ }, | ||
| loggerExtension === null || loggerExtension === void 0 ? void 0 : loggerExtension.fatal(message); | ||
| if (mirrorToConsole) | ||
| console.error(`${prefix} [FATAL] ${message}`); | ||
| waiter.notifyAll(); | ||
@@ -36,0 +78,0 @@ }, |
+2
-2
| { | ||
| "name": "@applitools/logger", | ||
| "version": "2.2.12", | ||
| "version": "2.2.13", | ||
| "description": "Applitools logger", | ||
@@ -52,3 +52,3 @@ "keywords": [ | ||
| "dependencies": { | ||
| "@applitools/utils": "1.14.5", | ||
| "@applitools/utils": "1.15.0", | ||
| "chalk": "4.1.2", | ||
@@ -55,0 +55,0 @@ "debug": "4.3.4" |
| import type { LogLevel } from './log-level'; | ||
| import type { LogLevelName, SpyLogger } from './types'; | ||
| export declare function makeSpyLogger({ level }?: { | ||
| export declare function makeSpyLogger({ level, label }?: { | ||
| level?: LogLevelName | LogLevel; | ||
| label?: string; | ||
| }): SpyLogger; |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
75441
3.78%981
4.58%0
-100%4
33.33%+ Added
- Removed
Updated