Skip to content

Commit

Permalink
Improve logging in legacy megolm code (#3043)
Browse files Browse the repository at this point in the history
* Use a PrefixedLogger throughout `megolm.ts`

Rather than manually adding `in ${this.roomId}` to each log line, use a
PrefixedLogger to achieve the same effect more consistently.

* Clean up logging in megolm.ts

Where we log a list of devices, we don't need the whole deviceinfo, just the
device id. All that noise makes it very hard to read the logs.

* Log users that we find in the room when encrypting

* Reduce log verbosity on decryption retries
  • Loading branch information
richvdh authored Jan 12, 2023
1 parent 9e37980 commit d23c3cb
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 84 deletions.
2 changes: 2 additions & 0 deletions spec/unit/crypto/algorithms/megolm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,10 @@ describe("MegolmDecryption", function () {
mockCrypto.baseApis = mockBaseApis;

mockRoom = {
roomId: ROOM_ID,
getEncryptionTargetMembers: jest.fn().mockReturnValue([{ userId: "@alice:home.server" }]),
getBlacklistUnverifiedDevices: jest.fn().mockReturnValue(false),
shouldEncryptForInvitedMembers: jest.fn().mockReturnValue(false),
} as unknown as Room;
});

Expand Down
Loading

0 comments on commit d23c3cb

Please sign in to comment.