@@ -22,6 +22,7 @@ type XetBlobCreateOptions = {
2222 * For intenral tests
2323 */
2424 debug ?: ( arg : { event : "read" } ) => void ;
25+ internalLogging ?: boolean ;
2526} & Partial < CredentialsParams > ;
2627
2728export interface ReconstructionInfo {
@@ -81,10 +82,6 @@ interface ChunkHeader {
8182
8283const CHUNK_HEADER_BYTES = 8 ;
8384
84- const log = ( ...args : unknown [ ] ) => {
85- console . log ( ...args ) ;
86- } ;
87-
8885/**
8986 * XetBlob is a blob implementation that fetches data directly from the Xet storage
9087 */
@@ -96,6 +93,7 @@ export class XetBlob extends Blob {
9693 hash : string ;
9794 start = 0 ;
9895 end = 0 ;
96+ internalLogging = false ;
9997 reconstructionInfo : ReconstructionInfo | undefined ;
10098 debug : XetBlobCreateOptions [ "debug" ] ;
10199
@@ -109,6 +107,7 @@ export class XetBlob extends Blob {
109107 this . end = params . size ;
110108 this . hash = params . hash ;
111109 this . debug = params . debug ;
110+ this . internalLogging = params . internalLogging ?? false ;
112111 this . hubUrl ;
113112 }
114113
@@ -130,6 +129,7 @@ export class XetBlob extends Blob {
130129 blob . end = this . end ;
131130 blob . reconstructionInfo = this . reconstructionInfo ;
132131 blob . debug = this . debug ;
132+ blob . internalLogging = this . internalLogging ;
133133
134134 return blob ;
135135 }
@@ -205,6 +205,7 @@ export class XetBlob extends Blob {
205205 rangeList . add ( term . range . start , term . range . end ) ;
206206 }
207207 const debug = this . debug ;
208+ const log = this . internalLogging ? console . log : ( ) => { } ;
208209
209210 async function * readData (
210211 reconstructionInfo : ReconstructionInfo ,
0 commit comments