Skip to content

Commit

Permalink
chore: remove redudant leadId from logging
Browse files Browse the repository at this point in the history
  • Loading branch information
PfisterFactor committed Oct 31, 2024
1 parent 31c874b commit 09d4f63
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/external/twilio/TwilioIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ export class TwilioIntegration
{
_meta: 1,
label: [
leadState.LeadId,
`${this.Name}/createWeb2TextConversation`,
],
},
Expand Down
12 changes: 0 additions & 12 deletions src/restate/LeadVirtualObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export const LeadVirtualObject = restate.object({
ctx: restate.ObjectSharedContext<LeadState>,
req?: Record<string, any>,
): Promise<LeadState> => {
ctx.console.info(`Lead ID: ${ctx.key}`, { _meta: 1, label: ctx.key });
// Validate the API key
await CheckAuthorization(
ctx as unknown as restate.ObjectSharedContext,
Expand All @@ -81,7 +80,6 @@ export const LeadVirtualObject = restate.object({
ctx: restate.ObjectContext<LeadState>,
req: Record<string, any>,
): Promise<LeadState> => {
ctx.console.info(`Lead ID: ${ctx.key}`, { _meta: 1, label: ctx.key });
// Validate the API key
await CheckAuthorization(
ctx as unknown as restate.ObjectSharedContext,
Expand Down Expand Up @@ -142,7 +140,6 @@ export const LeadVirtualObject = restate.object({
ctx: restate.ObjectContext<LeadState>,
req?: Record<string, any>,
): Promise<LeadState> => {
ctx.console.info(`Lead ID: ${ctx.key}`, { _meta: 1, label: ctx.key });
// Validate the API key
await CheckAuthorization(
ctx as unknown as restate.ObjectSharedContext,
Expand Down Expand Up @@ -176,7 +173,6 @@ export const LeadVirtualObject = restate.object({
`Executing 'create' for external integration '${integration.Name}'`,
{
_meta: 1,
label: ctx.key,
Integration: integration.Name,
CurrentSyncState: state,
},
Expand All @@ -186,7 +182,6 @@ export const LeadVirtualObject = restate.object({
`Finished 'create' for external integration '${integration.Name}' with status: '${newState.SyncStatus}'`,
{
_meta: 1,
label: ctx.key,
Integration: integration.Name,
OldSyncState: state,
CurrentSyncState: newState,
Expand All @@ -197,7 +192,6 @@ export const LeadVirtualObject = restate.object({
`Executing 'sync' for external integration '${integration.Name}'`,
{
_meta: 1,
label: ctx.key,
Integration: integration.Name,
CurrentSyncState: state,
},
Expand All @@ -207,7 +201,6 @@ export const LeadVirtualObject = restate.object({
`Finished 'sync' for external integration '${integration.Name}' with status: '${newState.SyncStatus}'`,
{
_meta: 1,
label: ctx.key,
Integration: integration.Name,
OldSyncState: state,
CurrentSyncState: newState,
Expand All @@ -230,7 +223,6 @@ export const LeadVirtualObject = restate.object({
`Error executing '${operation}' for external integration '${integration.Name}'`,
{
_meta: 1,
label: ctx.key,
Integration: integration.Name,
OldSyncState: state,
CurrentSyncState: newState,
Expand Down Expand Up @@ -263,7 +255,6 @@ export const LeadVirtualObject = restate.object({
ctx: restate.ObjectContext<LeadState>,
req?: { reason?: string; API_KEY?: string },
): Promise<LeadState> => {
ctx.console.info(`Lead ID: ${ctx.key}`, { _meta: 1, label: ctx.key });
// Validate the API key
await CheckAuthorization(
ctx as unknown as restate.ObjectSharedContext,
Expand Down Expand Up @@ -295,7 +286,6 @@ export const LeadVirtualObject = restate.object({
`Executing 'close' for external integration '${integration.Name}'`,
{
_meta: 1,
label: ctx.key,
Integration: integration.Name,
CurrentSyncState: state,
},
Expand All @@ -305,7 +295,6 @@ export const LeadVirtualObject = restate.object({
`Finished 'close' for external integration '${integration.Name}' with status '${newState.SyncStatus}'`,
{
_meta: 1,
label: ctx.key,
Integration: integration.Name,
OldSyncState: state,
CurrentSyncState: newState,
Expand All @@ -326,7 +315,6 @@ export const LeadVirtualObject = restate.object({
`Error executing 'close' for external integration '${integration.Name}'`,
{
_meta: 1,
label: ctx.key,
Integration: integration.Name,
OldSyncState: state,
CurrentSyncState: newState,
Expand Down
4 changes: 2 additions & 2 deletions src/restate/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function SyncWithDB(
) {
ctx.console.debug(
`Begin DynamoDB lead state sync with direction: ${direction}`,
{ _meta: 1, label: ctx.key },
{ _meta: 1},
);
let synced = false;
switch (direction) {
Expand Down Expand Up @@ -72,7 +72,7 @@ export async function SyncWithDB(
}
ctx.console.debug(
`End DynamoDB lead state sync with direction: ${direction}`,
{ _meta: 1, label: ctx.key, Success: synced },
{ _meta: 1, Success: synced },
);
return synced;
}

0 comments on commit 09d4f63

Please sign in to comment.