From 541f41995a2d6aac3b19c7b17a99bba8cef036b8 Mon Sep 17 00:00:00 2001 From: Falk Pauser Date: Tue, 21 Jan 2020 22:57:35 +0100 Subject: [PATCH] Log unknown tags with debug() --- lib/parser.js | 4 ++-- package.json | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/parser.js b/lib/parser.js index 1e284ff4..632e69b2 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -1,4 +1,4 @@ - +var logUnknownTag = require('debug')('ipp:unknownTag'); var enums = require('./enums'), operations = enums['operations-supported'], @@ -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; }; diff --git a/package.json b/package.json index abbe6a67..1cafe74c 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,9 @@ "name": "William Kapke", "email": "william.kapke@gmail.com" }, + "dependencies": { + "debug": "^4.1.1" + }, "devDependencies": { "concat-stream": "^1.6.0", "mdns": "^2.3.3",