Skip to content

Commit e3e744b

Browse files
authored
Add color allowance check to console logger options
1 parent a117a2a commit e3e744b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/common/services/console-logger.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { inspect, InspectOptions } from 'util';
22
import { Injectable, Optional } from '../decorators/core';
3-
import { clc, yellow } from '../utils/cli-colors.util';
3+
import { clc, yellow, isColorAllowed } from '../utils/cli-colors.util';
44
import {
55
isFunction,
66
isPlainObject,
@@ -154,7 +154,7 @@ export class ConsoleLogger implements LoggerService {
154154

155155
opts = opts ?? {};
156156
opts.logLevels ??= DEFAULT_LOG_LEVELS;
157-
opts.colors ??= opts.colors ?? (opts.json ? false : true);
157+
opts.colors ??= opts.colors ?? (opts.json ? false : isColorAllowed());
158158
opts.prefix ??= 'Nest';
159159

160160
this.options = opts;

0 commit comments

Comments
 (0)