import { open, log, option, facility, level } from 'modern-syslog';
open('test', option.LOG_PID, facility.LOG_USER);
// GOOD
log(level[level.LOG_EMERG], 'emergency as string');
log(level[level.LOG_ALERT], 'alert as string');
log(level[level.LOG_CRIT], 'critical as string');
log(level[level.LOG_ERR], 'error as string');
log(level[level.LOG_WARNING], 'warning as string');
log(level[level.LOG_NOTICE], 'notice as string');
log(level[level.LOG_INFO], 'info as string');
log(level[level.LOG_DEBUG], 'debug as string');
// All levels are 0 in syslog
log(level.LOG_EMERG, 'emergency as number');
log(level.LOG_ALERT, 'alert as number');
log(level.LOG_CRIT, 'critical as number');
log(level.LOG_ERR, 'error as number');
log(level.LOG_WARNING, 'warning as number');
log(level.LOG_NOTICE, 'notice as number');
log(level.LOG_INFO, 'info as number');
log(level.LOG_DEBUG, 'debug as number');
Hi !
I have something strange with the levels: