@threadbase-sh/streamer 1.43.0 → 1.44.1

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.
@@ -4554,6 +4554,9 @@ var baseLogger = (0, import_pino.default)({
4554
4554
  censor: "[redacted]"
4555
4555
  }
4556
4556
  });
4557
+ function defaultDest() {
4558
+ return process.stdout.isTTY ? "console" : "pino";
4559
+ }
4557
4560
  function emit(pinoChild, level, msg, fields, dest) {
4558
4561
  if (dest === "pino" || dest === "both") {
4559
4562
  if (fields && Object.keys(fields).length > 0) pinoChild[level](fields, msg);
@@ -4566,11 +4569,11 @@ function emit(pinoChild, level, msg, fields, dest) {
4566
4569
  }
4567
4570
  function build(pinoChild) {
4568
4571
  return {
4569
- debug: (m, f, d = "both") => emit(pinoChild, "debug", m, f, d),
4570
- info: (m, f, d = "both") => emit(pinoChild, "info", m, f, d),
4571
- warn: (m, f, d = "both") => emit(pinoChild, "warn", m, f, d),
4572
- error: (m, f, d = "both") => emit(pinoChild, "error", m, f, d),
4573
- log: (lvl, m, f, d = "both") => emit(pinoChild, lvl, m, f, d),
4572
+ debug: (m, f, d = defaultDest()) => emit(pinoChild, "debug", m, f, d),
4573
+ info: (m, f, d = defaultDest()) => emit(pinoChild, "info", m, f, d),
4574
+ warn: (m, f, d = defaultDest()) => emit(pinoChild, "warn", m, f, d),
4575
+ error: (m, f, d = defaultDest()) => emit(pinoChild, "error", m, f, d),
4576
+ log: (lvl, m, f, d = defaultDest()) => emit(pinoChild, lvl, m, f, d),
4574
4577
  pino: pinoChild
4575
4578
  };
4576
4579
  }