Skip to content

Commit

Permalink
Log unknown tags with debug()
Browse files Browse the repository at this point in the history
  • Loading branch information
fpauser committed Jan 21, 2020
1 parent eb8bc99 commit 541f419
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/parser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

var logUnknownTag = require('debug')('ipp:unknownTag');

var enums = require('./enums'),
operations = enums['operations-supported'],
Expand Down Expand Up @@ -189,7 +189,7 @@ module.exports = function(buf) {
};
module.exports.handleUnknownTag = function log(tag, name, length, read) {
var value = length? read(length) : undefined;
console.log("The spec is not clear on how to handle tag " +tag+ ": " +name+ "=" +String(value)+ ". " +
logUnknownTag("The spec is not clear on how to handle tag " +tag+ ": " +name+ "=" +String(value)+ ". " +
"Please open a github issue to help find a solution!");
return value;
};
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"name": "William Kapke",
"email": "[email protected]"
},
"dependencies": {
"debug": "^4.1.1"
},
"devDependencies": {
"concat-stream": "^1.6.0",
"mdns": "^2.3.3",
Expand Down

0 comments on commit 541f419

Please sign in to comment.