You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// -- set bootstrapUrls to match the network litNetwork unless it's set to custom
199
201
this.setCustomBootstrapUrls();
200
202
201
-
// -- set misc global variables
202
-
setMiscLitConfig(this.config);
203
-
bootstrapLogManager('core');
203
+
// -- set global variables
204
+
globalThis.litConfig=this.config;
205
+
bootstrapLogManager(
206
+
'core',
207
+
this.config.debug ? LogLevel.DEBUG : LogLevel.OFF
208
+
);
204
209
205
210
// -- configure local storage if not present
206
211
// LitNodeClientNodejs is a base for LitNodeClient
@@ -672,7 +677,12 @@ export class LitCore {
672
677
this.config.bootstrapUrls.length
673
678
} nodes. Please check your network connection and try again. Note that you can control this timeout with the connectTimeout config option which takes milliseconds.`;
// TODO: currently we are not deleting old request id's which over time will fill local storage as the maximum storage size is 10mb
341
358
// we should be deleting keys from the front of the collection of `Object.keys(category)` such that the first keys entered are deleted when we reach a pre defined key threshold
342
359
// this implementation assumes that serialization / deserialization from `localStorage` keeps the same key ordering in each `category` object as we will asssume the array produced from `Object.keys` will always be the same ordering.
@@ -421,14 +438,20 @@ export class LogManager {
421
438
}
422
439
423
440
getLoggerIds(): string[]{
424
-
constkeys: string[]=[];
441
+
constkeys: [string,number][]=[];
425
442
for(constcategoryofthis._loggers.entries()){
426
443
for(constchildofcategory[1].Children){
427
-
keys.push(child[0]);
444
+
keys.push([child[0],child[1].timestamp]);
428
445
}
429
446
}
430
447
431
-
returnkeys;
448
+
returnkeys
449
+
.sort((a: [string,number],b: [string,number])=>{
450
+
returna[1]-b[1];
451
+
})
452
+
.map((value: [string,number])=>{
453
+
returnvalue[0];
454
+
});
432
455
}
433
456
434
457
// if a logger is given an id it will persist logs under its logger instance
0 commit comments