Skip to content

Commit

Permalink
INT-9599 Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Ferrero committed Sep 21, 2023
1 parent f5a5e1e commit 59242bb
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions packages/integration-sdk-runtime/src/logger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const bunyanFormat = require('bunyan-format');

interface CreateLoggerInput<
TExecutionContext extends ExecutionContext,
TStepExecutionContext extends StepExecutionContext
TStepExecutionContext extends StepExecutionContext,
> {
name: string;
invocationConfig?: InvocationConfig<TExecutionContext, TStepExecutionContext>;
Expand All @@ -55,7 +55,8 @@ interface CreateLoggerInput<
}

interface CreateIntegrationLoggerInput<
TIntegrationConfig extends IntegrationInstanceConfig = IntegrationInstanceConfig
TIntegrationConfig extends
IntegrationInstanceConfig = IntegrationInstanceConfig,
> extends CreateLoggerInput<
IntegrationExecutionContext<TIntegrationConfig>,
IntegrationStepExecutionContext<TIntegrationConfig>
Expand All @@ -65,7 +66,7 @@ interface CreateIntegrationLoggerInput<

export function createLogger<
TExecutionContext extends ExecutionContext,
TStepExecutionContext extends StepExecutionContext
TStepExecutionContext extends StepExecutionContext,
>({
name,
pretty,
Expand Down Expand Up @@ -116,7 +117,8 @@ export function createLogger<
* serializers common to all integrations.
*/
export function createIntegrationLogger<
TIntegrationConfig extends IntegrationInstanceConfig = IntegrationInstanceConfig
TIntegrationConfig extends
IntegrationInstanceConfig = IntegrationInstanceConfig,
>({
name,
invocationConfig,
Expand All @@ -125,7 +127,7 @@ export function createIntegrationLogger<
onFailure,
}: CreateIntegrationLoggerInput<TIntegrationConfig>): IntegrationLogger {
const serializeInstanceConfig = createInstanceConfigSerializer(
invocationConfig?.instanceConfigFields
invocationConfig?.instanceConfigFields,
);

return createLogger({
Expand All @@ -147,7 +149,7 @@ export function createIntegrationLogger<
}

function createInstanceConfigSerializer<
TConfig extends IntegrationInstanceConfig = IntegrationInvocationConfig
TConfig extends IntegrationInstanceConfig = IntegrationInvocationConfig,
>(fields?: IntegrationInstanceConfigFieldMap<TConfig>) {
return (config: any) => {
if (!config) {
Expand Down Expand Up @@ -240,7 +242,7 @@ export class IntegrationLogger
},
{
logMetric: false,
}
},
);

return this._logger.warn(...params);
Expand Down Expand Up @@ -268,7 +270,7 @@ export class IntegrationLogger

return this._logger.trace(
{ verbose: true, ...additionalFields },
...remainingArgs
...remainingArgs,
);
}

Expand All @@ -282,7 +284,7 @@ export class IntegrationLogger
},
{
logMetric: false,
}
},
);

this._logger.error(...params);
Expand All @@ -304,7 +306,7 @@ export class IntegrationLogger

emit<T extends EventLookup, K extends keyof EventLookup>(
name: K,
data: T[K]
data: T[K],
) {
return super.emit(name, data);
}
Expand All @@ -326,7 +328,7 @@ export class IntegrationLogger
stepSkip(
step: StepMetadata,
reason: DisabledStepReason,
additionalContext?: StepLogAdditionalContext
additionalContext?: StepLogAdditionalContext,
) {
if (!reason || reason === DisabledStepReason.NONE) {
return;
Expand Down Expand Up @@ -376,7 +378,7 @@ export class IntegrationLogger
const eventName = 'step_failure';
const { errorId, description } = createErrorEventDescription(
err,
`Step "${step.name}" failed to complete due to error.`
`Step "${step.name}" failed to complete due to error.`,
);
this.handleFailure({ eventName, errorId, err, description });
}
Expand All @@ -388,7 +390,7 @@ export class IntegrationLogger
{
synchronizationJobId: job.id,
},
description
description,
);
this.publishEvent({ name, description });
}
Expand All @@ -400,7 +402,7 @@ export class IntegrationLogger
{
synchronizationJobId: job.id,
},
description
description,
);
this.publishEvent({ name, description });
}
Expand All @@ -409,7 +411,7 @@ export class IntegrationLogger
const eventName = 'validation_failure';
const { errorId, description } = createErrorEventDescription(
err,
`Error occurred while validating integration configuration.`
`Error occurred while validating integration configuration.`,
);
this.handleFailure({ eventName, errorId, err, description });
}
Expand Down Expand Up @@ -443,7 +445,7 @@ export class IntegrationLogger

publishMetric(
metric: Omit<Metric, 'timestamp'>,
{ logMetric = true }: PublishMetricOptions = {}
{ logMetric = true }: PublishMetricOptions = {},
) {
const metricWithTimestamp = {
...metric,
Expand Down Expand Up @@ -497,7 +499,7 @@ export function createErrorEventDescription(
* Optional data that will be added as name/value pairs to the
* event description.
*/
eventData?: object
eventData?: object,
) {
const errorId = uuid();

Expand Down

0 comments on commit 59242bb

Please sign in to comment.