@salesforce/core 8.13.0 → 8.14.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.
@@ -391,11 +391,17 @@ class Logger {
391
391
  exports.Logger = Logger;
392
392
  /** return various streams that the logger could send data to, depending on the options and env */
393
393
  const getWriteStream = (level = 'warn') => {
394
+ const env = new kit_1.Env();
394
395
  // used when debug mode, writes to stdout (colorized)
395
396
  if (process.env.DEBUG) {
396
397
  return {
397
398
  target: 'pino-pretty',
398
- options: { colorize: true },
399
+ options: {
400
+ // NOTE: env.getBoolean() defaults to false if the env var is not set
401
+ // so it's important to use `||` instead of `??`
402
+ colorize: env.getBoolean('SF_LOG_COLORIZE') || true,
403
+ destination: env.getBoolean('SF_LOG_STDERR') ? 2 : 1,
404
+ },
399
405
  };
400
406
  }
401
407
  // default: we're writing to a rotating file
@@ -404,7 +410,7 @@ const getWriteStream = (level = 'warn') => {
404
410
  ['1h', new Date().toISOString().split(':').slice(0, 1).join('-')],
405
411
  ['1d', new Date().toISOString().split('T')[0]],
406
412
  ]);
407
- const logRotationPeriod = new kit_1.Env().getString('SF_LOG_ROTATION_PERIOD') ?? '1d';
413
+ const logRotationPeriod = env.getString('SF_LOG_ROTATION_PERIOD') ?? '1d';
408
414
  return {
409
415
  // write to a rotating file
410
416
  target: 'pino/file',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "8.13.0",
3
+ "version": "8.14.1",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/index",
6
6
  "types": "lib/index.d.ts",