diff --git a/packages/av-cliper/src/combinator.ts b/packages/av-cliper/src/combinator.ts index 0d076717..ecbdaad9 100644 --- a/packages/av-cliper/src/combinator.ts +++ b/packages/av-cliper/src/combinator.ts @@ -159,9 +159,14 @@ export class Combinator { os: OffscreenSprite, opts: { main?: boolean } = {}, ): Promise { - this.#log.info('Combinator add sprite', os); + const logAttrs = { + rect: pick(['x', 'y', 'w', 'h'], os.rect), + time: { ...os.time }, + zIndex: os.zIndex, + }; + this.#log.info('Combinator add sprite', logAttrs); const newOS = await os.clone(); - this.#log.info('Combinator add sprite ready', os); + this.#log.info('Combinator add sprite ready'); this.#sprites.push( Object.assign(newOS, { main: opts.main ?? false, @@ -519,3 +524,13 @@ export function createAudioTrackBuf(adFrames: number) { return getAudioData(ts); }; } + +function pick(keys: K[], obj: T) { + return keys.reduce( + (acc, key) => { + acc[key] = obj[key]; + return acc; + }, + {} as Record, + ); +}