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

PR 1 (correction_string_tagging mit master mergen) gemergt

Wenn die übergebenen "Tags" keine Stings sind, sondern ein Stacktrace dann funktionieren die String-prototypes (includes) natürlich nicht.. Hier noch die Prüfung auf String-type.

Evtl. gehts auch schöner. :-)
parents 3b5f30ab f69412fd
No related branches found
No related tags found
1 merge request!1Update index.test.js, examples/all-options.js, examples/log-to-file.js,...
Pipeline #7257 failed
......@@ -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':
......
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