@dynamic-labs/logger 4.9.2 → 4.9.4

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,26 @@
1
1
 
2
+ ### [4.9.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.3...v4.9.4) (2025-03-17)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * **logger:** don't try to store data if localStorage is not available ([#8309](https://github.com/dynamic-labs/dynamic-auth/issues/8309)) ([30164c7](https://github.com/dynamic-labs/dynamic-auth/commit/30164c7de7bbf1463c6f6a7c12c4b60b5cfb6e78))
8
+ * modal corners ([#8308](https://github.com/dynamic-labs/dynamic-auth/issues/8308)) ([2d21d87](https://github.com/dynamic-labs/dynamic-auth/commit/2d21d87466cee4ab3b981b24fa15f5c321b163f5))
9
+
10
+ ### [4.9.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.2...v4.9.3) (2025-03-14)
11
+
12
+
13
+ ### Features
14
+
15
+ * allow adding extra text to ToS and PP footer using custom css ([#8290](https://github.com/dynamic-labs/dynamic-auth/issues/8290)) ([0f6eb26](https://github.com/dynamic-labs/dynamic-auth/commit/0f6eb2666ea93a32360710ba5ac14eac53e07e2d))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * log out if there is a mismatch in user and wallet state ([#8300](https://github.com/dynamic-labs/dynamic-auth/issues/8300)) ([82ec2ad](https://github.com/dynamic-labs/dynamic-auth/commit/82ec2add1682a576d00dfe13aa1b9cccecf96688))
21
+ * sol sponsored tx for v3 ([#8288](https://github.com/dynamic-labs/dynamic-auth/issues/8288)) ([c466fba](https://github.com/dynamic-labs/dynamic-auth/commit/c466fba417d39641631e29104ec9c156dfdf7647))
22
+ * v3 existing wallet could not log in again ([#8282](https://github.com/dynamic-labs/dynamic-auth/issues/8282)) ([c2d68ad](https://github.com/dynamic-labs/dynamic-auth/commit/c2d68adf575fcce371e438076184ef590f346c9f))
23
+
2
24
  ### [4.9.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.1...v4.9.2) (2025-03-12)
3
25
 
4
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/logger",
3
- "version": "4.9.2",
3
+ "version": "4.9.4",
4
4
  "description": "A simple client side logging library used in Dynamic SDK",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
package/src/index.cjs CHANGED
@@ -32,6 +32,19 @@ class Logger {
32
32
  else {
33
33
  this.level = level;
34
34
  }
35
+ if (typeof window !== 'undefined' && window.localStorage !== undefined) {
36
+ Logger.troubleshootModeEnabled =
37
+ window.localStorage.getItem('dynamic_enableTroubleshootMode') ===
38
+ 'true';
39
+ window.enableTroubleshootMode = () => {
40
+ window.localStorage.setItem('dynamic_enableTroubleshootMode', 'true');
41
+ Logger.troubleshootModeEnabled = true;
42
+ };
43
+ window.disableTroubleshootMode = () => {
44
+ window.localStorage.removeItem('dynamic_enableTroubleshootMode');
45
+ Logger.troubleshootModeEnabled = false;
46
+ };
47
+ }
35
48
  }
36
49
  static setEmitErrors(emit) {
37
50
  if (emit !== undefined) {
@@ -154,8 +167,7 @@ class Logger {
154
167
  });
155
168
  }
156
169
  log(level, message, ...args) {
157
- const enableTroubleshootMode = typeof window !== 'undefined' &&
158
- (window === null || window === void 0 ? void 0 : window.dynamic_enableTroubleshootMode) === true;
170
+ const enableTroubleshootMode = typeof window !== 'undefined' && Logger.troubleshootModeEnabled;
159
171
  if (!enableTroubleshootMode &&
160
172
  (level < this.level || level === types.LogLevel.MUTE)) {
161
173
  return;
@@ -195,6 +207,7 @@ class Logger {
195
207
  Logger.globalKeys = {
196
208
  emitErrors: true,
197
209
  };
210
+ Logger.troubleshootModeEnabled = false;
198
211
  Logger.globalMetaData = new MetaData.MetaData();
199
212
  Logger.events = new EventEmitter__default["default"]();
200
213
 
package/src/index.d.ts CHANGED
@@ -22,6 +22,7 @@ export declare class Logger {
22
22
  private name;
23
23
  private level;
24
24
  private static globalKeys;
25
+ static troubleshootModeEnabled: boolean;
25
26
  static globalMetaData: MetaData;
26
27
  metaData: MetaData;
27
28
  constructor(name: string | string[], level?: LogLevel);
package/src/index.js CHANGED
@@ -25,6 +25,19 @@ class Logger {
25
25
  else {
26
26
  this.level = level;
27
27
  }
28
+ if (typeof window !== 'undefined' && window.localStorage !== undefined) {
29
+ Logger.troubleshootModeEnabled =
30
+ window.localStorage.getItem('dynamic_enableTroubleshootMode') ===
31
+ 'true';
32
+ window.enableTroubleshootMode = () => {
33
+ window.localStorage.setItem('dynamic_enableTroubleshootMode', 'true');
34
+ Logger.troubleshootModeEnabled = true;
35
+ };
36
+ window.disableTroubleshootMode = () => {
37
+ window.localStorage.removeItem('dynamic_enableTroubleshootMode');
38
+ Logger.troubleshootModeEnabled = false;
39
+ };
40
+ }
28
41
  }
29
42
  static setEmitErrors(emit) {
30
43
  if (emit !== undefined) {
@@ -147,8 +160,7 @@ class Logger {
147
160
  });
148
161
  }
149
162
  log(level, message, ...args) {
150
- const enableTroubleshootMode = typeof window !== 'undefined' &&
151
- (window === null || window === void 0 ? void 0 : window.dynamic_enableTroubleshootMode) === true;
163
+ const enableTroubleshootMode = typeof window !== 'undefined' && Logger.troubleshootModeEnabled;
152
164
  if (!enableTroubleshootMode &&
153
165
  (level < this.level || level === LogLevel.MUTE)) {
154
166
  return;
@@ -188,6 +200,7 @@ class Logger {
188
200
  Logger.globalKeys = {
189
201
  emitErrors: true,
190
202
  };
203
+ Logger.troubleshootModeEnabled = false;
191
204
  Logger.globalMetaData = new MetaData();
192
205
  Logger.events = new EventEmitter();
193
206
 
package/src/types.d.ts CHANGED
@@ -5,6 +5,12 @@ export declare enum LogLevel {
5
5
  ERROR = 3,
6
6
  MUTE = 99
7
7
  }
8
+ declare global {
9
+ interface Window {
10
+ enableTroubleshootMode: () => void;
11
+ disableTroubleshootMode: () => void;
12
+ }
13
+ }
8
14
  export type Message = string | Error | unknown;
9
15
  export type MessageQueueMessage = {
10
16
  level: LogLevel;