Add NO_COLOR standard environment flag to sync-server logging. (#5676)

* Add NO_COLOR standard environment flag to sync-server logging.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Michael Sanford
2025-09-05 18:31:12 -04:00
committed by GitHub
parent bbf91ccbca
commit 8e5a88bc55
2 changed files with 9 additions and 1 deletions

View File

@@ -48,7 +48,9 @@ const validateSessionMiddleware = async (req, res, next) => {
const requestLoggerMiddleware = expressWinston.logger({
transports: [new winston.transports.Console()],
format: winston.format.combine(
winston.format.colorize(),
...(Object.prototype.hasOwnProperty.call(process.env, 'NO_COLOR')
? []
: [winston.format.colorize()]),
winston.format.timestamp(),
winston.format.printf(args => {
const { timestamp, level, meta } = args;

View File

@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [michaelsanford]
---
Add NO_COLOR standard environment flag to sync-server logging (https://no-color.org/).