Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tag: (
lines,
{
level = "",
maxVerbosity = 1,
verbosity = 1,
enable = true,
levelColor = {
info: cyan,
warn: yellow,
error: red.bright.inverse,
debug: blue
}
}
) => {
if (!enable) {
return [];
}
const levelStr =
level && (levelColor[level] || (s => s))(level.toUpperCase());
if (verbosity <= maxVerbosity) {
if (level) {
// Add level only to the first line
let retVal = lines.map((l, i) => {
if (i === 0) {
return levelStr.padStart(6) + ": " + l;
} else {