@hmawla/co-assistant 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +9 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -27,11 +27,19 @@ function resolveLogLevel() {
|
|
|
27
27
|
const valid = ["fatal", "error", "warn", "info", "debug", "trace", "silent"];
|
|
28
28
|
return envLevel && valid.includes(envLevel) ? envLevel : "info";
|
|
29
29
|
}
|
|
30
|
+
function isPinoPrettyAvailable() {
|
|
31
|
+
try {
|
|
32
|
+
import.meta.resolve("pino-pretty");
|
|
33
|
+
return true;
|
|
34
|
+
} catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
30
38
|
function buildLoggerOptions() {
|
|
31
39
|
const level = resolveLogLevel();
|
|
32
40
|
const isProduction = process.env.NODE_ENV === "production";
|
|
33
41
|
const opts = { level };
|
|
34
|
-
if (!isProduction) {
|
|
42
|
+
if (!isProduction && isPinoPrettyAvailable()) {
|
|
35
43
|
opts.transport = {
|
|
36
44
|
target: "pino-pretty",
|
|
37
45
|
options: {
|