P4.2-W: replace console.log with logger in CCLiveTranscriptionShapeUtil

This commit is contained in:
CC Worker 2026-05-31 21:37:45 +00:00
parent bf592886c6
commit 3afba919c4
2 changed files with 10 additions and 8 deletions

View File

@ -111,6 +111,7 @@ export type LogCategory =
| 'user-context'
| 'neo-user-context'
| 'neo-institute-context'
| 'cc-live-transcription'
| 'search-service';
interface LogConfig {

View File

@ -6,6 +6,7 @@ import { TranscriptionManager } from '../cc-transcription/TranscriptionManager';
import { ccShapeProps, getDefaultCCLiveTranscriptionProps } from '../cc-props';
import { ccShapeMigrations } from '../cc-migrations';
import { CC_BASE_STYLE_CONSTANTS } from '../cc-styles';
import { logger } from '../../../../debugConfig';
export interface TranscriptionSegment {
id: string
@ -207,11 +208,11 @@ export class CCLiveTranscriptionShapeUtil extends CCBaseShapeUtil<CCLiveTranscri
}
private toggleRecording(shape: CCLiveTranscriptionShape) {
console.log('🎤 Toggle recording clicked');
logger.debug('cc-live-transcription', '🎤 Toggle recording clicked');
const { id } = shape;
const { isRecording } = shape.props;
console.log('Current state:', { id, isRecording });
logger.debug('cc-live-transcription', 'Current state', { id, isRecording });
// When starting new recording, preserve existing props but reset segments
const newProps = !isRecording ? {
@ -232,13 +233,13 @@ export class CCLiveTranscriptionShapeUtil extends CCBaseShapeUtil<CCLiveTranscri
});
const manager = TranscriptionManager.getManager(this.editor);
console.log('Got transcription manager');
logger.debug('cc-live-transcription', 'Got transcription manager');
if (!isRecording) {
console.log('Starting transcription...');
logger.debug('cc-live-transcription', 'Starting transcription...');
manager.startTranscription(id);
} else {
console.log('Stopping transcription...');
logger.debug('cc-live-transcription', 'Stopping transcription...');
manager.stopTranscription();
}
}
@ -249,10 +250,10 @@ export class CCLiveTranscriptionShapeUtil extends CCBaseShapeUtil<CCLiveTranscri
isConfirmed: boolean,
metadata?: { start: string | number, end: string | number }
) {
console.log('📝 Updating text:', { id, text, isConfirmed, metadata });
logger.debug('cc-live-transcription', '📝 Updating text', { id, text, isConfirmed, metadata });
const shape = this.editor.getShape<CCLiveTranscriptionShape>(id);
if (!shape) {
console.warn('❌ Shape not found for updating text:', id);
logger.warn('cc-live-transcription', '❌ Shape not found for updating text', id);
return;
}
@ -308,7 +309,7 @@ export class CCLiveTranscriptionShapeUtil extends CCBaseShapeUtil<CCLiveTranscri
});
}
console.log('✅ Text updated');
logger.debug('cc-live-transcription', '✅ Text updated');
}
}