Skip to content

Commit

Permalink
feat: log state (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
cool-firer authored Oct 16, 2024
1 parent c03e0d7 commit 8666576
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions packages/network-support/src/stateManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,35 @@ export class StateManager {
});
this.logger?.debug(`syncChannelState [multiple] succeed`);
} else {
this.logger?.debug(`syncChannelState [multiple] failed: ${convertResult.error}`);
// this.logger?.debug(`syncChannelState [multiple] failed: ${convertResult.error}`);
this.logger?.error({
type: 'state_convert',
deploymentId: this.projectId,
channelId,
res: JSON.stringify(convertResult),
state: JSON.stringify(state),
});
}
} else {
this.logger?.debug(`syncChannelState [multiple] failed: ${JSON.stringify(res)}`);
// this.logger?.debug(`syncChannelState [multiple] failed: ${JSON.stringify(res)}`);
this.logger?.error({
type: 'state_empty',
deploymentId: this.projectId,
channelId,
res: JSON.stringify(res),
state: JSON.stringify(state),
});
}
} catch (e) {
this.logger?.debug(`syncChannelState [multiple] failed: ${e}`);
} catch (e: any) {
// this.logger?.debug(`syncChannelState [multiple] failed: ${e}`);
this.logger?.error({
type: 'state_error',
deploymentId: this.projectId,
channelId,
error: e.message,
stack: e.stack,
state: JSON.stringify(state),
});
}
}
}
Expand Down

0 comments on commit 8666576

Please sign in to comment.