merge: replace console.log with logger in CCLiveTranscriptionShapeUtil (P3b)
This commit is contained in:
commit
33b9278085
@ -111,6 +111,7 @@ export type LogCategory =
|
|||||||
| 'user-context'
|
| 'user-context'
|
||||||
| 'neo-user-context'
|
| 'neo-user-context'
|
||||||
| 'neo-institute-context'
|
| 'neo-institute-context'
|
||||||
|
| 'cc-live-transcription'
|
||||||
| 'search-service';
|
| 'search-service';
|
||||||
|
|
||||||
interface LogConfig {
|
interface LogConfig {
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import { TranscriptionManager } from '../cc-transcription/TranscriptionManager';
|
|||||||
import { ccShapeProps, getDefaultCCLiveTranscriptionProps } from '../cc-props';
|
import { ccShapeProps, getDefaultCCLiveTranscriptionProps } from '../cc-props';
|
||||||
import { ccShapeMigrations } from '../cc-migrations';
|
import { ccShapeMigrations } from '../cc-migrations';
|
||||||
import { CC_BASE_STYLE_CONSTANTS } from '../cc-styles';
|
import { CC_BASE_STYLE_CONSTANTS } from '../cc-styles';
|
||||||
|
import { logger } from '../../../../debugConfig';
|
||||||
|
|
||||||
export interface TranscriptionSegment {
|
export interface TranscriptionSegment {
|
||||||
id: string
|
id: string
|
||||||
@ -207,11 +208,11 @@ export class CCLiveTranscriptionShapeUtil extends CCBaseShapeUtil<CCLiveTranscri
|
|||||||
}
|
}
|
||||||
|
|
||||||
private toggleRecording(shape: CCLiveTranscriptionShape) {
|
private toggleRecording(shape: CCLiveTranscriptionShape) {
|
||||||
console.log('🎤 Toggle recording clicked');
|
logger.debug('cc-live-transcription', '🎤 Toggle recording clicked');
|
||||||
const { id } = shape;
|
const { id } = shape;
|
||||||
const { isRecording } = shape.props;
|
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
|
// When starting new recording, preserve existing props but reset segments
|
||||||
const newProps = !isRecording ? {
|
const newProps = !isRecording ? {
|
||||||
@ -232,13 +233,13 @@ export class CCLiveTranscriptionShapeUtil extends CCBaseShapeUtil<CCLiveTranscri
|
|||||||
});
|
});
|
||||||
|
|
||||||
const manager = TranscriptionManager.getManager(this.editor);
|
const manager = TranscriptionManager.getManager(this.editor);
|
||||||
console.log('Got transcription manager');
|
logger.debug('cc-live-transcription', 'Got transcription manager');
|
||||||
|
|
||||||
if (!isRecording) {
|
if (!isRecording) {
|
||||||
console.log('Starting transcription...');
|
logger.debug('cc-live-transcription', 'Starting transcription...');
|
||||||
manager.startTranscription(id);
|
manager.startTranscription(id);
|
||||||
} else {
|
} else {
|
||||||
console.log('Stopping transcription...');
|
logger.debug('cc-live-transcription', 'Stopping transcription...');
|
||||||
manager.stopTranscription();
|
manager.stopTranscription();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -249,10 +250,10 @@ export class CCLiveTranscriptionShapeUtil extends CCBaseShapeUtil<CCLiveTranscri
|
|||||||
isConfirmed: boolean,
|
isConfirmed: boolean,
|
||||||
metadata?: { start: string | number, end: string | number }
|
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);
|
const shape = this.editor.getShape<CCLiveTranscriptionShape>(id);
|
||||||
if (!shape) {
|
if (!shape) {
|
||||||
console.warn('❌ Shape not found for updating text:', id);
|
logger.warn('cc-live-transcription', '❌ Shape not found for updating text', id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,7 +309,7 @@ export class CCLiveTranscriptionShapeUtil extends CCBaseShapeUtil<CCLiveTranscri
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('✅ Text updated');
|
logger.debug('cc-live-transcription', '✅ Text updated');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user