Skip to content

Commit

Permalink
feat(app): add succesful dd log to passportscorerclient (passportxyz#945
Browse files Browse the repository at this point in the history
)

* feat(app): add succesful dd log to passportscorerclient

* feat: diff scorer from ceramic getPassport logs

---------

Co-authored-by: Chibuotu Amadi <[email protected]>
  • Loading branch information
Tim Schultz and chibie authored Feb 7, 2023
1 parent 0dc79e5 commit 7c9895e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions database-client/src/ceramicClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export class CeramicDatabase implements DataStorageBase {

try {
const ceramicPassport = await this.store.get("Passport");
this.logger.info(`loaded passport for did ${this.did} => ${JSON.stringify(ceramicPassport)}`);
this.logger.info(`[Ceramic] Loaded passport for did ${this.did} => ${JSON.stringify(ceramicPassport)}`);

// According to the logs, it does happen that passport is sometimes an empty object {}
// We treat this case as an non-existent passport
Expand All @@ -199,7 +199,7 @@ export class CeramicDatabase implements DataStorageBase {
}
} catch (e) {
status = "ExceptionRaised";
this.logger.error(`Error when loading passport for did ${this.did}:` + e.toString(), { error: e });
this.logger.error(`[Ceramic] Error when loading passport for did ${this.did}:` + e.toString(), { error: e });
} finally {
const possiblePassportCacaoErrorStatuses: PassportLoadStatus[] = ["DoesNotExist", "ExceptionRaised"];
if (possiblePassportCacaoErrorStatuses.includes(status) && (await this.checkPassportCACAOError()))
Expand Down
4 changes: 3 additions & 1 deletion database-client/src/passportScorerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export class PassportDatabase implements DataStorageBase {

try {
const response = await axios.get(`${this.passportScorerUrl}ceramic-cache/stamp?address=${this.address}`);
this.logger.info(`[Scorer] Loaded passport for did ${this.did} => ${this.address}`);

const { data } = response;
if (data && data.success && (this.allowEmpty || data.stamps.length !== 0)) {
passport = {
Expand All @@ -64,7 +66,7 @@ export class PassportDatabase implements DataStorageBase {
}
} catch (e) {
status = "ExceptionRaised";
this.logger.error(`Error when loading passport for did ${this.address}:` + e.toString(), { error: e });
this.logger.error(`[Scorer] Error when loading passport for did ${this.address}:` + e.toString(), { error: e });
} finally {
return {
passport,
Expand Down

0 comments on commit 7c9895e

Please sign in to comment.