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.
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")