@dynamic-labs/logger 1.0.6 → 1.0.8

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,23 @@
1
1
 
2
+ ### [1.0.8](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.7...v1.0.8) (2024-01-26)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * pass id to wagmi chain override ([#4512](https://github.com/dynamic-labs/DynamicAuth/issues/4512)) ([#4514](https://github.com/dynamic-labs/DynamicAuth/issues/4514)) ([0e6da01](https://github.com/dynamic-labs/DynamicAuth/commit/0e6da0108d30b9ae65062126f4a41543740acc87))
8
+
9
+ ### [1.0.7](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.6...v1.0.7) (2024-01-25)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * add support for newest backpack extension ([66786ce](https://github.com/dynamic-labs/DynamicAuth/commit/66786ceb7927046c1cdb439888271f3070ca93a4))
15
+ * broken help icon in create passkey view ([2e38ea5](https://github.com/dynamic-labs/DynamicAuth/commit/2e38ea580e55f3349a2d3040d7b07bb2923631f7))
16
+ * connect to wallet with wallet connect even if network is not supported ([#4465](https://github.com/dynamic-labs/DynamicAuth/issues/4465)) ([#4472](https://github.com/dynamic-labs/DynamicAuth/issues/4472)) ([8270b94](https://github.com/dynamic-labs/DynamicAuth/commit/8270b9468c289e7c49cd2ef104fb73dfaaa9f41c))
17
+ * infinite loop when connecting with trust wallet ([#4448](https://github.com/dynamic-labs/DynamicAuth/issues/4448)) ([#4450](https://github.com/dynamic-labs/DynamicAuth/issues/4450)) ([c5ffee6](https://github.com/dynamic-labs/DynamicAuth/commit/c5ffee67a6a95ee62e779da69ce311c90575388f))
18
+ * logging in with an email linked to a third party wallet gets stu… ([#4422](https://github.com/dynamic-labs/DynamicAuth/issues/4422)) ([995889b](https://github.com/dynamic-labs/DynamicAuth/commit/995889b5d03bcbafecd6959c52a88db8d9db940e))
19
+ * switching wallet in extension caused connected flag to be false ([#4464](https://github.com/dynamic-labs/DynamicAuth/issues/4464)) ([a53dc1a](https://github.com/dynamic-labs/DynamicAuth/commit/a53dc1a9869a270c98753041cfbd587855629af4)), closes [#4454](https://github.com/dynamic-labs/DynamicAuth/issues/4454)
20
+
2
21
  ### [1.0.6](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.5...v1.0.6) (2024-01-18)
3
22
 
4
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/logger",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
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) {