Skip to content

Commit

Permalink
TEMP: feat: add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeg committed Apr 25, 2024
1 parent 314ae34 commit 34becf8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/services/identity/CollaboratorsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,14 @@ class CollaboratorsService {
},
},
],
logging: (sql, timing) =>
logger.info({
message: "getRole() original query details",
meta: {
sql,
timing,
},
}),
})

const role = site?.site_members?.[0]?.SiteMember?.role
Expand Down Expand Up @@ -284,6 +292,14 @@ class CollaboratorsService {
{
replacements: { siteName, userId },
type: QueryTypes.SELECT,
logging: (sql, timing) =>
logger.info({
message: "getRole() option 1 query details",
meta: {
sql,
timing,
},
}),
}
)) as { role: CollaboratorRoles }[]

Expand All @@ -302,6 +318,14 @@ class CollaboratorsService {
{
replacements: { siteName, userId },
type: QueryTypes.SELECT,
logging: (sql, timing) =>
logger.info({
message: "getRole() option 2 query details",
meta: {
sql,
timing,
},
}),
}
)) as { role: CollaboratorRoles }[]

Expand Down

0 comments on commit 34becf8

Please sign in to comment.