Skip to content
Snippets Groups Projects
Commit 1ed49792 authored by Herfort, Thomas's avatar Herfort, Thomas
Browse files

index.js aktualisiert

parent 3b5f30ab
Branches
Tags
1 merge request!1Update index.test.js, examples/all-options.js, examples/log-to-file.js,...
...@@ -71,7 +71,7 @@ function Log (options) { ...@@ -71,7 +71,7 @@ function Log (options) {
} }
this.log = function (tag, message, tags) { this.log = function (tag, message, tags) {
let tadd = '' let tadd = ''
if (typeof tags !== 'undefined') { if (typeof tags !== 'undefined' && typeof tags === 'string') {
if (Array.isArray(tags)) { if (Array.isArray(tags)) {
tadd = ' #' + tags.join(' #') tadd = ' #' + tags.join(' #')
} else if (tags.includes(' ')) { } else if (tags.includes(' ')) {
...@@ -81,7 +81,8 @@ function Log (options) { ...@@ -81,7 +81,8 @@ function Log (options) {
} else { } else {
tadd = ' #' + tags tadd = ' #' + tags
} }
} } else { tadd = tags}
let msg = this.getDate() + '\t' + this.hostname + '\t' + this.name + '\t' + tag + '\t' + message + tadd let msg = this.getDate() + '\t' + this.hostname + '\t' + this.name + '\t' + tag + '\t' + message + tadd
switch (tag) { switch (tag) {
case 'INFO': case 'INFO':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment