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