improved logger

This commit is contained in:
Bojan Kucera 2025-06-07 10:07:49 -04:00
parent e8485dd140
commit 0f510bfa33
9 changed files with 110 additions and 1250 deletions

View file

@ -97,7 +97,7 @@ export class ProxyService {
try {
await this.scrapeProxies();
} catch (error) {
this.logger.error('Error in periodic proxy refresh', { error });
this.logger.error('Error in periodic proxy refresh', {error});
}
}, intervalMs);
}
@ -169,7 +169,7 @@ export class ProxyService {
} catch (error) {
this.logger.error('Error scraping from source', {
url: source.url,
error: error instanceof Error ? error.message : String(error)
error: error
});
return [];
}
@ -318,7 +318,7 @@ export class ProxyService {
}
}
} catch (error) {
this.logger.error('Error updating proxy status', { error });
this.logger.error('Error updating proxy status', {error});
}
}
/**
@ -346,7 +346,7 @@ export class ProxyService {
this.logger.warn('No working proxies available');
return null;
} catch (error) {
this.logger.error('Error getting working proxy', { error });
this.logger.error('Error getting working proxy', {error});
return null;
}
}
@ -371,7 +371,7 @@ export class ProxyService {
return workingProxies;
} catch (error) {
this.logger.error('Error getting working proxies', { error });
this.logger.error('Error getting working proxies', {error});
return [];
}
}
@ -391,7 +391,7 @@ export class ProxyService {
this.logger.warn('getAllProxies not fully implemented - Redis cache provider limitations');
return proxies;
} catch (error) {
this.logger.error('Error getting all proxies', { error });
this.logger.error('Error getting all proxies', {error});
return [];
}
}
@ -424,7 +424,7 @@ export class ProxyService {
return stats;
} catch (error) {
this.logger.error('Error getting proxy stats', { error });
this.logger.error('Error getting proxy stats', {error});
return {
total: 0,
working: 0,
@ -485,7 +485,7 @@ export class ProxyService {
stillWorking: successCount
});
} catch (error) {
this.logger.error('Error in health check', { error });
this.logger.error('Error in health check', {error});
}
}, intervalMs);
}
@ -502,7 +502,7 @@ export class ProxyService {
this.logger.info('Cleared proxy stats from cache');
this.logger.warn('Full proxy data clearing not implemented due to cache provider limitations');
} catch (error) {
this.logger.error('Error clearing proxy data', { error });
this.logger.error('Error clearing proxy data', {error});
}
}