use convertBytesToHumanReadable for logging
This commit is contained in:
parent
4d868ffe5c
commit
afa9ba0521
|
@ -1,6 +1,6 @@
|
|||
import { ElectronAPIs } from 'types/electron';
|
||||
import { ElectronFile } from 'types/upload';
|
||||
import { makeHumanReadableStorage } from 'utils/billing';
|
||||
import { convertBytesToHumanReadable } from 'utils/file/size';
|
||||
import { addLogLine } from 'utils/logging';
|
||||
import { logError } from 'utils/sentry';
|
||||
|
||||
|
@ -29,9 +29,9 @@ class ElectronImageProcessorService {
|
|||
inputFileData
|
||||
);
|
||||
addLogLine(
|
||||
`originalFileSize:${makeHumanReadableStorage(
|
||||
`originalFileSize:${convertBytesToHumanReadable(
|
||||
fileBlob?.size
|
||||
)},convertedFileSize:${makeHumanReadableStorage(
|
||||
)},convertedFileSize:${convertBytesToHumanReadable(
|
||||
convertedFileData?.length
|
||||
)}, native heic conversion time: ${Date.now() - startTime}ms `
|
||||
);
|
||||
|
@ -58,9 +58,9 @@ class ElectronImageProcessorService {
|
|||
maxSize
|
||||
);
|
||||
addLogLine(
|
||||
`originalFileSize:${makeHumanReadableStorage(
|
||||
`originalFileSize:${convertBytesToHumanReadable(
|
||||
inputFile?.size
|
||||
)},thumbFileSize:${makeHumanReadableStorage(
|
||||
)},thumbFileSize:${convertBytesToHumanReadable(
|
||||
thumb?.length
|
||||
)}, native thumbnail generation time: ${
|
||||
Date.now() - startTime
|
||||
|
|
|
@ -3,10 +3,10 @@ import { CustomError } from 'utils/error';
|
|||
import { retryAsyncFunction } from 'utils/network';
|
||||
import { logError } from 'utils/sentry';
|
||||
import { addLogLine } from 'utils/logging';
|
||||
import { makeHumanReadableStorage } from 'utils/billing';
|
||||
import { DedicatedConvertWorker } from 'worker/convert.worker';
|
||||
import { ComlinkWorker } from 'utils/comlink/comlinkWorker';
|
||||
import { getDedicatedConvertWorker } from 'utils/comlink';
|
||||
import { convertBytesToHumanReadable } from 'utils/file/size';
|
||||
|
||||
const WORKER_POOL_SIZE = 2;
|
||||
const MAX_CONVERSION_IN_PARALLEL = 1;
|
||||
|
@ -52,9 +52,9 @@ class HEICConverter {
|
|||
CONVERT_FORMAT
|
||||
);
|
||||
addLogLine(
|
||||
`originalFileSize:${makeHumanReadableStorage(
|
||||
`originalFileSize:${convertBytesToHumanReadable(
|
||||
fileBlob?.size
|
||||
)},convertedFileSize:${makeHumanReadableStorage(
|
||||
)},convertedFileSize:${convertBytesToHumanReadable(
|
||||
convertedHEIC?.size
|
||||
)}, heic conversion time: ${
|
||||
Date.now() - startTime
|
||||
|
@ -74,10 +74,10 @@ class HEICConverter {
|
|||
Error(`converted heic fileSize is Zero`),
|
||||
'converted heic fileSize is Zero',
|
||||
{
|
||||
originalFileSize: makeHumanReadableStorage(
|
||||
originalFileSize: convertBytesToHumanReadable(
|
||||
fileBlob?.size ?? 0
|
||||
),
|
||||
convertedFileSize: makeHumanReadableStorage(
|
||||
convertedFileSize: convertBytesToHumanReadable(
|
||||
convertedHEIC?.size ?? 0
|
||||
),
|
||||
}
|
||||
|
|
|
@ -29,8 +29,8 @@ import {
|
|||
import { IsArchived, updateMagicMetadataProps } from 'utils/magicMetadata';
|
||||
|
||||
import { addLogLine } from 'utils/logging';
|
||||
import { makeHumanReadableStorage } from 'utils/billing';
|
||||
import { CustomError } from 'utils/error';
|
||||
import { convertBytesToHumanReadable } from './size';
|
||||
|
||||
const WAIT_TIME_IMAGE_CONVERSION = 30 * 1000;
|
||||
|
||||
|
@ -352,7 +352,7 @@ async function getPlayableVideo(videoNameTitle: string, video: Uint8Array) {
|
|||
async function getRenderableImage(fileName: string, imageBlob: Blob) {
|
||||
if (await isFileHEIC(imageBlob, fileName)) {
|
||||
addLogLine(
|
||||
`HEICConverter called for ${fileName}-${makeHumanReadableStorage(
|
||||
`HEICConverter called for ${fileName}-${convertBytesToHumanReadable(
|
||||
imageBlob.size
|
||||
)}`
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue