Skip to content

Commit 7a499ea

Browse files
committed
Fixes the Priority order, closes #5
1 parent 02ee88d commit 7a499ea

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ function parsePRI(raw) {
6161
// PRI means Priority, includes Facility and Severity
6262
// e.g. 10110111 = 10110: facility 111: severity
6363
var binary = (~~raw).toString(2)
64-
var facility = parseInt(binary.substr(binary.length - 3), 2)
65-
var severity = parseInt(binary.substring(0, binary.length - 3), 2)
64+
var severity = parseInt(binary.substr(binary.length - 3), 2)
65+
var facility = parseInt(binary.substring(0, binary.length - 3), 2)
6666
return [facility, severity]
6767
}
6868

test/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ describe( "given a syslogd service", () => {
1313
//console.log(info)
1414
info.port = null // port is random
1515
var shouldRet = {
16-
facility: 7
17-
, severity: 22
16+
facility: 22
17+
, severity: 7
1818
, tag: 'tag'
1919
, time: new Date(time + ' ' + new Date().getFullYear())
2020
, hostname: 'hostname'

test/tcp.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ describe( "given a TCP Syslog Server", () => {
1717
info.address = null
1818
info.family = null
1919
var shouldRet = {
20-
facility: 7
21-
, severity: 22
20+
facility: 22
21+
, severity: 7
2222
, tag: 'tag'
2323
, time: new Date(time + ' ' + new Date().getFullYear())
2424
, hostname: 'hostname'

0 commit comments

Comments
 (0)