@bsv/wallet-toolbox 1.7.5 → 1.7.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsv/wallet-toolbox",
3
- "version": "1.7.5",
3
+ "version": "1.7.7",
4
4
  "description": "BRC100 conforming wallet, wallet storage and wallet signer components",
5
5
  "main": "./out/src/index.js",
6
6
  "types": "./out/src/index.d.ts",
@@ -108,13 +108,20 @@ export class WalletLogger implements WalletLoggerInterface {
108
108
  }
109
109
 
110
110
  flush(): object | undefined {
111
- const trace = this.toLogString()
112
- const log = this.flushFormat === 'json' ? JSON.stringify({
113
- name: 'WalletLogger.flush',
114
- trace
115
- }) : trace
116
- if (this.isError) console.error(log)
117
- else console.log(log)
111
+ if (this.logs.length > 0) {
112
+ const trace = this.toLogString()
113
+ const output = this.isError ? console.error : console.log
114
+ if (this.flushFormat === 'json') {
115
+ const name = this.logs[0].log
116
+ const log = {
117
+ name,
118
+ trace
119
+ }
120
+ output(JSON.stringify(log))
121
+ } else {
122
+ output(trace)
123
+ }
124
+ }
118
125
  const r = this.isOrigin ? undefined : this.toWalletLoggerJson()
119
126
  return r
120
127
  }
@@ -165,6 +165,10 @@ export class StorageServer {
165
165
  logger = this.makeLogger(params[1]['logger'])
166
166
  params[1]['logger'] = logger
167
167
  logger.group(`StorageSever ${method}`)
168
+ const userId = params[0]?.['identityKey']
169
+ const identityKey = params[0]?.['identityKey']
170
+ if (userId) logger.log(`userId: ${userId}`)
171
+ if (identityKey) logger.log(`identityKey: ${identityKey}`)
168
172
  }
169
173
 
170
174
  try {