@zenuml/core 3.48.2 → 3.48.3

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.
@@ -9406,13 +9406,33 @@ const logger = pino({
9406
9406
  level: "warn"
9407
9407
  });
9408
9408
  const LEVELS = ["log", "trace", "debug", "info", "warn", "error"];
9409
+ const PINO_LEVEL = {
9410
+ log: "info",
9411
+ trace: "trace",
9412
+ debug: "debug",
9413
+ info: "info",
9414
+ warn: "warn",
9415
+ error: "error"
9416
+ };
9417
+ function isEnabled(target, level) {
9418
+ const loggerTarget = target;
9419
+ return loggerTarget.isLevelEnabled?.(PINO_LEVEL[level]) ?? true;
9420
+ }
9409
9421
  function bind(target, level) {
9410
9422
  const consoleFn = level in console ? console[level] : console.log;
9411
- target[level] = consoleFn.bind(console);
9423
+ target[level] = (...args) => {
9424
+ if (isEnabled(target, level)) {
9425
+ consoleFn(...args);
9426
+ }
9427
+ };
9412
9428
  }
9413
9429
  function bind2(target, level, prefix) {
9414
9430
  const consoleFn = level in console ? console[level] : console.log;
9415
- target[level] = consoleFn.bind(console, prefix[0], prefix[1]);
9431
+ target[level] = (...args) => {
9432
+ if (isEnabled(target, level)) {
9433
+ consoleFn(prefix[0], prefix[1], ...args);
9434
+ }
9435
+ };
9416
9436
  }
9417
9437
  function prettify(target) {
9418
9438
  LEVELS.forEach((level) => bind(target, level));