Add Logging singleton to manually control Mediabunny's console output (fixes #415)

This commit is contained in:
Vanilagy
2026-06-18 19:32:18 +02:00
parent 92a384f418
commit cdc2ef63dd
28 changed files with 324 additions and 65 deletions
+4 -3
View File
@@ -23,6 +23,7 @@ import {
} from './encode';
import { Input } from './input';
import { InputAudioTrack, InputTrack, InputVideoTrack } from './input-track';
import { Logging } from './logging';
import {
AudioSampleSink,
EncodedPacketSink,
@@ -958,7 +959,7 @@ export class Conversion {
}
if (warnElements.length > 0) {
console.warn(...warnElements);
Logging._warn(...warnElements);
}
}
}
@@ -1122,7 +1123,7 @@ export class Conversion {
}
if (this._canceled) {
console.warn('Conversion already canceled.');
Logging._warn('Conversion already canceled.');
return;
}
@@ -1327,7 +1328,7 @@ export class Conversion {
firstSample.close();
await tempOutput.finalize();
} catch (error) {
console.info('Error when probing encoder support. Falling back to rerender path.', error);
Logging._info('Error when probing encoder support. Falling back to rerender path.', error);
needsRerender = true;
void tempOutput.cancel();
}