diff --git a/index.js b/index.js index 0bf88a14a6f6a19481766d5b8d8929746853e4b6..b1726bbbeda7933e959d359343dd39c2bd9ff7f3 100644 --- a/index.js +++ b/index.js @@ -74,14 +74,15 @@ function Log (options) { if (typeof tags !== 'undefined') { if (Array.isArray(tags)) { tadd = ' #' + tags.join(' #') - } else if (tags.includes(' ')) { + } else if (typeof tags === 'string' && tags.includes(' ')) { tadd = ' #' + tags.split(' ').join(' #') - } else if (tags.includes(',')) { + } else if (typeof tags === 'string' && tags.includes(',')) { tadd = ' #' + tags.split(',').join(' #') } else { tadd = ' #' + tags } } + let msg = this.getDate() + '\t' + this.hostname + '\t' + this.name + '\t' + tag + '\t' + message + tadd switch (tag) { case 'INFO':