@moneypot/hub 1.8.0-dev.1 → 1.8.0-dev.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.
Files changed (2) hide show
  1. package/dist/src/logger.js +16 -8
  2. package/package.json +1 -1
@@ -3,15 +3,23 @@ import { LOG_LEVEL, LOG_PRETTY, NODE_ENV } from "./config.js";
3
3
  function createLogger(options) {
4
4
  const prettify = LOG_PRETTY === undefined ? NODE_ENV === "development" : LOG_PRETTY;
5
5
  if (prettify) {
6
- return pino({
7
- level: options.level,
8
- transport: {
9
- target: "pino-pretty",
10
- options: {
11
- colorize: true,
6
+ try {
7
+ return pino({
8
+ level: options.level,
9
+ transport: {
10
+ target: "pino-pretty",
11
+ options: {
12
+ colorize: true,
13
+ },
12
14
  },
13
- },
14
- });
15
+ });
16
+ }
17
+ catch (_e) {
18
+ console.warn("LOG_PRETTY=true but pino-pretty is not installed, falling back to standard logging");
19
+ return pino({
20
+ level: options.level,
21
+ });
22
+ }
15
23
  }
16
24
  else {
17
25
  return pino({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneypot/hub",
3
- "version": "1.8.0-dev.1",
3
+ "version": "1.8.0-dev.2",
4
4
  "author": "moneypot.com",
5
5
  "homepage": "https://moneypot.com/hub",
6
6
  "keywords": [