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

index.js aktualisiert

parent 1ed49792
No related branches found
No related tags found
1 merge request!1Update index.test.js, examples/all-options.js, examples/log-to-file.js,...
......@@ -71,17 +71,17 @@ function Log (options) {
}
this.log = function (tag, message, tags) {
let tadd = ''
if (typeof tags !== 'undefined' && typeof tags === 'string') {
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
}
} else { tadd = tags}
}
let msg = this.getDate() + '\t' + this.hostname + '\t' + this.name + '\t' + tag + '\t' + message + tadd
switch (tag) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment