@dynamic-labs/logger 2.2.1 → 2.2.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/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
1
 
2
+ ### [2.2.2](https://github.com/dynamic-labs/DynamicAuth/compare/v2.2.1...v2.2.2) (2024-06-18)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * make account change idemopotent ([#6062](https://github.com/dynamic-labs/DynamicAuth/issues/6062)) ([2308d32](https://github.com/dynamic-labs/DynamicAuth/commit/2308d32d18627f2673c8f4c9b5623a9c731e4752))
8
+
2
9
  ### [2.2.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.2.0...v2.2.1) (2024-06-17)
3
10
 
4
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/logger",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
package/src/index.cjs CHANGED
@@ -79,6 +79,7 @@ class Logger {
79
79
  }
80
80
  }
81
81
  formatMessage(level, message) {
82
+ var _a;
82
83
  if (message instanceof Error) {
83
84
  message = message.stack;
84
85
  }
@@ -92,7 +93,7 @@ class Logger {
92
93
  message = JSON.stringify(message);
93
94
  }
94
95
  const names = (Array.isArray(this.name) ? this.name : [this.name]).map((name) => `[${name}]`);
95
- return `${names.join('')} [${types.LogLevel[level]}]: ${message}`;
96
+ return `${names.join('')} [${(_a = types.LogLevel[level]) !== null && _a !== void 0 ? _a : 'TROUBLESHOOTING'}]: ${message}`;
96
97
  }
97
98
  captureAndSend(level, message, ...args) {
98
99
  return _tslib.__awaiter(this, void 0, void 0, function* () {
@@ -156,7 +157,10 @@ class Logger {
156
157
  }
157
158
  }
158
159
  log(level, message, ...args) {
159
- if (level < this.level || level === types.LogLevel.MUTE) {
160
+ const enableTroubleshootMode = typeof window !== 'undefined' &&
161
+ (window === null || window === void 0 ? void 0 : window.dynamic_enableTroubleshootMode) === true;
162
+ if (!enableTroubleshootMode &&
163
+ (level < this.level || level === types.LogLevel.MUTE)) {
160
164
  return;
161
165
  }
162
166
  const fmtMsg = this.formatMessage(level, message);
package/src/index.js CHANGED
@@ -72,6 +72,7 @@ class Logger {
72
72
  }
73
73
  }
74
74
  formatMessage(level, message) {
75
+ var _a;
75
76
  if (message instanceof Error) {
76
77
  message = message.stack;
77
78
  }
@@ -85,7 +86,7 @@ class Logger {
85
86
  message = JSON.stringify(message);
86
87
  }
87
88
  const names = (Array.isArray(this.name) ? this.name : [this.name]).map((name) => `[${name}]`);
88
- return `${names.join('')} [${LogLevel[level]}]: ${message}`;
89
+ return `${names.join('')} [${(_a = LogLevel[level]) !== null && _a !== void 0 ? _a : 'TROUBLESHOOTING'}]: ${message}`;
89
90
  }
90
91
  captureAndSend(level, message, ...args) {
91
92
  return __awaiter(this, void 0, void 0, function* () {
@@ -149,7 +150,10 @@ class Logger {
149
150
  }
150
151
  }
151
152
  log(level, message, ...args) {
152
- if (level < this.level || level === LogLevel.MUTE) {
153
+ const enableTroubleshootMode = typeof window !== 'undefined' &&
154
+ (window === null || window === void 0 ? void 0 : window.dynamic_enableTroubleshootMode) === true;
155
+ if (!enableTroubleshootMode &&
156
+ (level < this.level || level === LogLevel.MUTE)) {
153
157
  return;
154
158
  }
155
159
  const fmtMsg = this.formatMessage(level, message);