Skip to content

Commit

Permalink
feat(app): adds logging for ceramic connection event (passportxyz#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
farque65 authored Jun 10, 2022
1 parent 9e12055 commit 0ff5223
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/context/userContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import { ProviderSpec, STAMP_PROVIDERS } from "../config/providers";
import { EthereumAuthProvider } from "@self.id/web";
import { useViewerConnection } from "@self.id/framework";

// --- Datadog
import { datadogLogs } from "@datadog/browser-logs";
import { datadogRum } from "@datadog/browser-rum";

// -- Trusted IAM servers DID
const IAM_ISSUER_DID = process.env.NEXT_PUBLIC_DPOPP_IAM_ISSUER_DID || "";

Expand Down Expand Up @@ -200,9 +204,11 @@ export const UserContextProvider = ({ children }: { children: any }) => {
if (!address) {
connect({})
.then(() => {
datadogLogs.logger.info("Connected to Ceramic");
setLoggedIn(true);
})
.catch((e) => {
datadogRum.addError(e);
throw e;
});
} else {
Expand All @@ -217,6 +223,7 @@ export const UserContextProvider = ({ children }: { children: any }) => {
window.localStorage.setItem("connectedWallets", "[]");
})
.catch((e) => {
datadogRum.addError(e);
throw e;
});
}
Expand Down

0 comments on commit 0ff5223

Please sign in to comment.