]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
fix(simulator): accept winston log levels in log.level and map syslog names (#2189)
authorVitor Coelho <6161176+VitorCoelho@users.noreply.github.com>
Sun, 8 Nov 2026 13:39:43 +0000 (10:39 -0300)
committerGitHub <noreply@github.com>
Sun, 8 Nov 2026 13:39:43 +0000 (14:39 +0100)
commite1ce98458eeb60935d02a0aeb71e044f991cfccf
tree6e97a5b25942e4cadcf7c82ab0c76830df422712
parent7e5971539f9bcdd5deeeb2b28f1ce45647a95dab
fix(simulator): accept winston log levels in log.level and map syslog names (#2189)

* fix(simulator): accept winston log levels in log.level and map syslog names

The logger is created with winston's default npm levels (error, warn,
info, http, verbose, debug, silly), but the configuration schema only
accepted the syslog names emerg/alert/crit/error/warning/notice/info/debug
documented in the README:

- 'warn', 'http', 'verbose' and 'silly' were rejected at startup, although
  they are valid winston levels (they were passed to winston unchecked
  before the configuration validation added in 4.8.0);
- 'emerg', 'alert', 'crit', 'warning' and 'notice' were accepted, but
  winston does not know them, so the logger stopped writing anything,
  errors included.

Accept the npm levels and keep accepting the syslog names for backward
compatibility, mapped to the npm level of the same severity
(emerg/alert/crit -> error, warning -> warn, notice -> info). Update the
README accordingly.

Signed-off-by: VitorCoelho <vitorc195@gmail.com>
* docs(simulator): clarify which log outputs an unknown winston level silences

An unknown level silences the console and the main log file, but the error
file transport sets its own 'error' level and still logs errors.

Signed-off-by: VitorCoelho <vitorc195@gmail.com>
* test(simulator): pin deprecated logLevel syslog mapping and clarify JSDoc

Address the review findings on #2189:
- LogConfiguration JSDoc now references LOG_LEVELS and
  SYSLOG_LOG_LEVEL_ALIASES instead of re-enumerating the syslog->npm
  pairs, so the prose cannot drift when the alias map changes
- pin the non-identity composition through the deprecated top-level
  logLevel key ("logLevel": "warning" -> log.level "warn")

Closes #2188

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
---------

Signed-off-by: VitorCoelho <vitorc195@gmail.com>
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
Co-authored-by: Jérôme Benoit <jerome.benoit@sap.com>
README.md
src/utils/ConfigurationSchema.ts
tests/utils/ConfigurationSchema.test.ts