strongloop / modern-syslog

modern-syslog
Other
49 stars 19 forks source link

level doesn't work as number #40

Closed Awalgawe closed 3 years ago

Awalgawe commented 3 years ago

Hi !

I have something strange with the levels:

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');
Awalgawe commented 3 years ago

some context:

Awalgawe commented 3 years ago

Wow, forget: don't know why but this problem appears only in my jest test... o_O