@dynamic-labs/logger 1.1.0-alpha.12 → 1.1.0-alpha.14

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,29 @@
1
1
 
2
+ ## [1.1.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.13...v1.1.0-alpha.14) (2024-01-23)
3
+
4
+
5
+ ### Features
6
+
7
+ * add wallet-book retryable ([#4462](https://github.com/dynamic-labs/DynamicAuth/issues/4462)) ([513b1a6](https://github.com/dynamic-labs/DynamicAuth/commit/513b1a67d6c49624398ad4b0cdca4f5618c9583f))
8
+
9
+ ## [1.1.0-alpha.13](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.12...v1.1.0-alpha.13) (2024-01-23)
10
+
11
+
12
+ ### Features
13
+
14
+ * add createWalletClientFromWallet helper function ([#4416](https://github.com/dynamic-labs/DynamicAuth/issues/4416)) ([b384898](https://github.com/dynamic-labs/DynamicAuth/commit/b384898061bb3f9b38b2ed670b6650cfc1d4b429))
15
+ * add hardware wallets to wallet book ([#4445](https://github.com/dynamic-labs/DynamicAuth/issues/4445)) ([66c0f5b](https://github.com/dynamic-labs/DynamicAuth/commit/66c0f5b29a6a700099bb95a6f7622f6178e0bccf))
16
+ * add support for Argent Web and Mobile ([#4328](https://github.com/dynamic-labs/DynamicAuth/issues/4328)) ([bce20b8](https://github.com/dynamic-labs/DynamicAuth/commit/bce20b8f35a8630f2621f53a541a1acb06a38fc0))
17
+ * enable ledger for glow, solflare and backpack ([#4392](https://github.com/dynamic-labs/DynamicAuth/issues/4392)) ([fa7b992](https://github.com/dynamic-labs/DynamicAuth/commit/fa7b992f87ebc43560f87b43ac56f2cd9909b306))
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * breaking changes script ([#4440](https://github.com/dynamic-labs/DynamicAuth/issues/4440)) ([446173d](https://github.com/dynamic-labs/DynamicAuth/commit/446173d074d652d81856c6412e304b46b1565320))
23
+ * broken help icon in create passkey view ([#4428](https://github.com/dynamic-labs/DynamicAuth/issues/4428)) ([e0ffc02](https://github.com/dynamic-labs/DynamicAuth/commit/e0ffc02ffea34b7ac3198ff6e1baf7f9907acddd))
24
+ * infinite loop when connecting with trust wallet ([#4448](https://github.com/dynamic-labs/DynamicAuth/issues/4448)) ([4e20edf](https://github.com/dynamic-labs/DynamicAuth/commit/4e20edf9abaabf20e5e9f9167b44d7f691e844f1))
25
+ * render wagmi elements based on react version ([#4453](https://github.com/dynamic-labs/DynamicAuth/issues/4453)) ([43c624c](https://github.com/dynamic-labs/DynamicAuth/commit/43c624ca996b0c51de1454910f19fdf908149938))
26
+
2
27
  ## [1.1.0-alpha.12](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.11...v1.1.0-alpha.12) (2024-01-18)
3
28
 
4
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/logger",
3
- "version": "1.1.0-alpha.12",
3
+ "version": "1.1.0-alpha.14",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
package/src/index.cjs CHANGED
@@ -24,6 +24,12 @@ class Logger {
24
24
  this.level = level;
25
25
  }
26
26
  }
27
+ getNameArray(name) {
28
+ return Array.isArray(name) ? name : [name];
29
+ }
30
+ createLogger(name, level) {
31
+ return new Logger([...this.getNameArray(this.name), ...this.getNameArray(name)], level !== null && level !== void 0 ? level : this.level);
32
+ }
27
33
  get logLevel() {
28
34
  return exports.LogLevel[this.level];
29
35
  }
@@ -51,7 +57,8 @@ class Logger {
51
57
  else if (message instanceof Object) {
52
58
  message = JSON.stringify(message);
53
59
  }
54
- return `[${this.name}] [${exports.LogLevel[level]}]: ${message}`;
60
+ const names = (Array.isArray(this.name) ? this.name : [this.name]).map((name) => `[${name}]`);
61
+ return `${names.join('')} [${exports.LogLevel[level]}]: ${message}`;
55
62
  }
56
63
  log(level, message, ...args) {
57
64
  if (level < this.level || level === exports.LogLevel.MUTE) {
package/src/index.d.ts CHANGED
@@ -9,7 +9,9 @@ type Message = string | Error | unknown;
9
9
  export declare class Logger {
10
10
  private name;
11
11
  private level;
12
- constructor(name: string, level?: LogLevel);
12
+ constructor(name: string | string[], level?: LogLevel);
13
+ private getNameArray;
14
+ createLogger(name: string | string[], level?: LogLevel): Logger;
13
15
  get logLevel(): string;
14
16
  setLogLevel(level: LogLevel | keyof typeof LogLevel): void;
15
17
  private formatMessage;
package/src/index.js CHANGED
@@ -20,6 +20,12 @@ class Logger {
20
20
  this.level = level;
21
21
  }
22
22
  }
23
+ getNameArray(name) {
24
+ return Array.isArray(name) ? name : [name];
25
+ }
26
+ createLogger(name, level) {
27
+ return new Logger([...this.getNameArray(this.name), ...this.getNameArray(name)], level !== null && level !== void 0 ? level : this.level);
28
+ }
23
29
  get logLevel() {
24
30
  return LogLevel[this.level];
25
31
  }
@@ -47,7 +53,8 @@ class Logger {
47
53
  else if (message instanceof Object) {
48
54
  message = JSON.stringify(message);
49
55
  }
50
- return `[${this.name}] [${LogLevel[level]}]: ${message}`;
56
+ const names = (Array.isArray(this.name) ? this.name : [this.name]).map((name) => `[${name}]`);
57
+ return `${names.join('')} [${LogLevel[level]}]: ${message}`;
51
58
  }
52
59
  log(level, message, ...args) {
53
60
  if (level < this.level || level === LogLevel.MUTE) {