@openfn/logger
Advanced tools
+6
-0
| # @openfn/logger | ||
| ## 1.1.0 | ||
| ### Minor Changes | ||
| - 2cc28a6: Add colour to output | ||
| ## 1.0.6 | ||
@@ -4,0 +10,0 @@ |
+17
-1
@@ -200,2 +200,16 @@ // src/logger.ts | ||
| var WARN = "warn"; | ||
| var colourize = (level, str) => { | ||
| if (typeof str === "string") { | ||
| if (level === DEBUG) { | ||
| return c.grey(str); | ||
| } | ||
| if (level === ERROR) { | ||
| return c.red(str); | ||
| } | ||
| if (level === WARN) { | ||
| return c.yellow(str); | ||
| } | ||
| } | ||
| return str; | ||
| }; | ||
| var priority = { | ||
@@ -284,3 +298,5 @@ [DEBUG]: 0, | ||
| } | ||
| emitter[level](...output.concat(cleanedArgs)); | ||
| emitter[level]( | ||
| ...output.concat(cleanedArgs).map((s) => colourize(level, s)) | ||
| ); | ||
| } | ||
@@ -287,0 +303,0 @@ } |
+1
-1
| { | ||
| "name": "@openfn/logger", | ||
| "version": "1.0.6", | ||
| "version": "1.1.0", | ||
| "description": "Cross-package logging utility", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
20366
1.9%532
3.1%1
Infinity%