Skip to content

Commit

Permalink
Fix timestamp prefix in logs (#1120)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ndpnt authored Nov 21, 2024
2 parents c30efbb + d154140 commit 04a9a67
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All changes that impact users of this module are documented in this file, in the [Common Changelog](https://common-changelog.org) format with some additional specifications defined in the CONTRIBUTING file. This codebase adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased [patch]

> Development of this release was supported by the [French Ministry for Foreign Affairs](https://www.diplomatie.gouv.fr/fr/politique-etrangere-de-la-france/diplomatie-numerique/) through its ministerial [State Startups incubator](https://beta.gouv.fr/startups/open-terms-archive.html) under the aegis of the Ambassador for Digital Affairs.
### Fixed

- Fix timestamp prefix format in logs

## 2.7.0 - 2024-11-20

_Full changeset and discussions: [#1118](https://github.com/OpenTermsArchive/engine/pull/1118)._
Expand Down
2 changes: 1 addition & 1 deletion scripts/dataset/logger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { combine, timestamp, printf, colorize } = winston.format;

logger.format = combine(
colorize(),
timestamp({ format: 'YYYY-MM-DDTHH:MM:SSZ' }),
timestamp({ format: 'YYYY-MM-DDTHH:mm:ssZ' }),
printf(({ level, message, counter, hash, timestamp }) => {
const prefix = counter && hash ? `${counter.toString().padEnd(6)} ${hash.padEnd(40)}` : '';

Expand Down
2 changes: 1 addition & 1 deletion src/collection-api/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if (config.get('@opentermsarchive/engine.logger.sendMailOnError')) {
const logger = winston.createLogger({
format: combine(
colorize(),
timestamp({ format: 'YYYY-MM-DDTHH:MM:SSZ' }),
timestamp({ format: 'YYYY-MM-DDTHH:mm:ssZ' }),
printf(({ level, message, timestamp }) => {
const timestampPrefix = config.get('@opentermsarchive/engine.logger.timestampPrefix') ? `${timestamp} ` : '';

Expand Down
2 changes: 1 addition & 1 deletion src/logger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { combine, timestamp, printf, colorize } = winston.format;

const alignedWithColorsAndTime = combine(
colorize(),
timestamp({ format: 'YYYY-MM-DDTHH:MM:SSZ' }),
timestamp({ format: 'YYYY-MM-DDTHH:mm:ssZ' }),
printf(({ level, message, timestamp, serviceId, termsType, documentId }) => {
const servicePrefix = serviceId && termsType
? `${serviceId}${termsType}${documentId ? `:${documentId}` : ''}`
Expand Down

0 comments on commit 04a9a67

Please sign in to comment.