Skip to content

Commit

Permalink
add forceStdOut
Browse files Browse the repository at this point in the history
  • Loading branch information
HBobertz committed Jan 9, 2025
1 parent b9a8c60 commit 3e9cfd6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/aws-cdk/lib/util/asset-publishing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import type { SDK } from '../api';
import type { SdkProvider } from '../api/aws-auth/sdk-provider';
import { Mode } from '../api/plugin/mode';
import { debug, error, print } from '../logging';
import { debug, error, print, data } from '../logging';

export interface PublishAssetsOptions {
/**
Expand Down Expand Up @@ -70,7 +70,6 @@ export async function publishAssets(
publishInParallel: options.parallel ?? true,
buildAssets: options.buildAssets ?? true,
publishAssets: true,
quiet: options.quiet,
});
await publisher.publish({ allowCrossAccount: options.allowCrossAccount });
if (publisher.hasFailures) {
Expand Down Expand Up @@ -235,8 +234,11 @@ export const EVENT_TO_LOGGER: Record<EventType, (x: string) => void> = {
class PublishingProgressListener implements IPublishProgressListener {
constructor(private readonly quiet: boolean) {}

public onPublishEvent(type: EventType, event: IPublishProgress): void {
const handler = this.quiet && type !== 'fail' ? debug : EVENT_TO_LOGGER[type];
public onPublishEvent(type: EventType, event: IPublishProgress, forceStdOut = false): void {
const handler = forceStdOut ? data
: this.quiet && type !== 'fail' ? debug
: EVENT_TO_LOGGER[type];

handler(`[${event.percentComplete}%] ${type}: ${event.message}`);
}
}

0 comments on commit 3e9cfd6

Please sign in to comment.