fixed up logger error to make it better to handle in code
This commit is contained in:
parent
db66687f48
commit
d0bb4db042
18 changed files with 51 additions and 45 deletions
|
|
@ -49,7 +49,7 @@ const workInterval = setInterval(() => {
|
||||||
try {
|
try {
|
||||||
await initiateShutdown();
|
await initiateShutdown();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Manual shutdown failed', { error });
|
logger.error('Manual shutdown failed', error);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ export class UnifiedDataProvider implements DataProvider {
|
||||||
try {
|
try {
|
||||||
data = await this.fetchFromQuestDB(symbol, from, to, interval);
|
data = await this.fetchFromQuestDB(symbol, from, to, interval);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.warn('Failed to fetch from QuestDB, generating simulated data', { error });
|
logger.warn('Failed to fetch from QuestDB, generating simulated data', error);
|
||||||
data = this.generateHistoricalData(symbol, from, to, interval);
|
data = this.generateHistoricalData(symbol, from, to, interval);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ onShutdown(async () => {
|
||||||
// await proxyService.shutdown();
|
// await proxyService.shutdown();
|
||||||
logger.info('✅ Proxy service cleanup completed');
|
logger.info('✅ Proxy service cleanup completed');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('❌ Proxy service cleanup failed', { error });
|
logger.error('❌ Proxy service cleanup failed', error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -182,7 +182,7 @@ demonstrateCustomProxySource()
|
||||||
}, 2000);
|
}, 2000);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
logger.error('💥 Proxy demo failed', { error });
|
logger.error('💥 Proxy demo failed', error);
|
||||||
clearShutdownTimer();
|
clearShutdownTimer();
|
||||||
setTimeout(() => process.exit(1), 1000);
|
setTimeout(() => process.exit(1), 1000);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ export class ProxyService {
|
||||||
try {
|
try {
|
||||||
await this.scrapeProxies();
|
await this.scrapeProxies();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Error in periodic proxy refresh', {error});
|
this.logger.error('Error in periodic proxy refresh', error);
|
||||||
}
|
}
|
||||||
}, intervalMs);
|
}, intervalMs);
|
||||||
}
|
}
|
||||||
|
|
@ -318,7 +318,7 @@ export class ProxyService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} 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');
|
this.logger.warn('No working proxies available');
|
||||||
return null;
|
return null;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Error getting working proxy', {error});
|
this.logger.error('Error getting working proxy', error);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -371,7 +371,7 @@ export class ProxyService {
|
||||||
|
|
||||||
return workingProxies;
|
return workingProxies;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Error getting working proxies', {error});
|
this.logger.error('Error getting working proxies', error);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -391,7 +391,7 @@ export class ProxyService {
|
||||||
this.logger.warn('getAllProxies not fully implemented - Redis cache provider limitations');
|
this.logger.warn('getAllProxies not fully implemented - Redis cache provider limitations');
|
||||||
return proxies;
|
return proxies;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Error getting all proxies', {error});
|
this.logger.error('Error getting all proxies', error);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -424,7 +424,7 @@ export class ProxyService {
|
||||||
|
|
||||||
return stats;
|
return stats;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Error getting proxy stats', {error});
|
this.logger.error('Error getting proxy stats', error);
|
||||||
return {
|
return {
|
||||||
total: 0,
|
total: 0,
|
||||||
working: 0,
|
working: 0,
|
||||||
|
|
@ -485,7 +485,7 @@ export class ProxyService {
|
||||||
stillWorking: successCount
|
stillWorking: successCount
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Error in health check', {error});
|
this.logger.error('Error in health check', error);
|
||||||
}
|
}
|
||||||
}, intervalMs);
|
}, intervalMs);
|
||||||
}
|
}
|
||||||
|
|
@ -502,7 +502,7 @@ export class ProxyService {
|
||||||
this.logger.info('Cleared proxy stats from cache');
|
this.logger.info('Cleared proxy stats from cache');
|
||||||
this.logger.warn('Full proxy data clearing not implemented due to cache provider limitations');
|
this.logger.warn('Full proxy data clearing not implemented due to cache provider limitations');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Error clearing proxy data', {error});
|
this.logger.error('Error clearing proxy data', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ async function runBacktest(options: CLIBacktestConfig): Promise<void> {
|
||||||
await eventBus.close();
|
await eventBus.close();
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Backtest failed', { error });
|
logger.error('Backtest failed', error);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
libs/cache/src/providers/hybrid-cache.ts
vendored
2
libs/cache/src/providers/hybrid-cache.ts
vendored
|
|
@ -185,7 +185,7 @@ export class HybridCache implements CacheProvider {
|
||||||
|
|
||||||
return isHealthy;
|
return isHealthy;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Hybrid cache health check failed', { error });
|
this.logger.error('Hybrid cache health check failed', error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
libs/cache/src/providers/memory-cache.ts
vendored
2
libs/cache/src/providers/memory-cache.ts
vendored
|
|
@ -222,7 +222,7 @@ export class MemoryCache implements CacheProvider {
|
||||||
await this.del('__health_check__');
|
await this.del('__health_check__');
|
||||||
return result === 'ok';
|
return result === 'ok';
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Memory cache health check failed', { error });
|
this.logger.error('Memory cache health check failed', error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
libs/cache/src/providers/redis-cache.ts
vendored
2
libs/cache/src/providers/redis-cache.ts
vendored
|
|
@ -212,7 +212,7 @@ export class RedisCache implements CacheProvider {
|
||||||
const pong = await this.redis.ping();
|
const pong = await this.redis.ping();
|
||||||
return pong === 'PONG' && this.isConnected;
|
return pong === 'PONG' && this.isConnected;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Redis health check failed', { error });
|
this.logger.error('Redis health check failed', error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ export class EventBus extends EventEmitter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(`Failed to subscribe to event: ${eventType}`, { error });
|
this.logger.error(`Failed to subscribe to event: ${eventType}`, error);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -271,7 +271,7 @@ export class EventBus extends EventEmitter {
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
retryCount++;
|
retryCount++;
|
||||||
this.logger.error(`Error processing stream message ${msgId} (attempt ${retryCount}):`, { error });
|
this.logger.error(`Error processing stream message ${msgId} (attempt ${retryCount}):`, error);
|
||||||
|
|
||||||
if (retryCount >= this.maxRetries) {
|
if (retryCount >= this.maxRetries) {
|
||||||
await this.moveToDeadLetterQueue(msgId, fields, streamKey, groupName, error);
|
await this.moveToDeadLetterQueue(msgId, fields, streamKey, groupName, error);
|
||||||
|
|
@ -325,7 +325,7 @@ export class EventBus extends EventEmitter {
|
||||||
|
|
||||||
this.logger.debug(`Claimed and processed ${claimedMessages.length} pending messages`);
|
this.logger.debug(`Claimed and processed ${claimedMessages.length} pending messages`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Error claiming pending messages:', { error });
|
this.logger.error('Error claiming pending messages:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -409,7 +409,7 @@ export class EventBus extends EventEmitter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(`Failed to unsubscribe from event: ${eventType}`, { error });
|
this.logger.error(`Failed to unsubscribe from event: ${eventType}`, error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -446,7 +446,7 @@ export class EventBus extends EventEmitter {
|
||||||
try {
|
try {
|
||||||
return await this.redis.xinfo('STREAM', streamKey);
|
return await this.redis.xinfo('STREAM', streamKey);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(`Failed to get stream info for: ${eventType}`, { error });
|
this.logger.error(`Failed to get stream info for: ${eventType}`, error);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -460,7 +460,7 @@ export class EventBus extends EventEmitter {
|
||||||
try {
|
try {
|
||||||
return await this.redis.xlen(streamKey);
|
return await this.redis.xlen(streamKey);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(`Failed to get stream length for: ${eventType}`, { error });
|
this.logger.error(`Failed to get stream length for: ${eventType}`, error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -489,7 +489,7 @@ export class EventBus extends EventEmitter {
|
||||||
id
|
id
|
||||||
}));
|
}));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(`Failed to read stream history for: ${eventType}`, { error });
|
this.logger.error(`Failed to read stream history for: ${eventType}`, error);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -503,7 +503,7 @@ export class EventBus extends EventEmitter {
|
||||||
try {
|
try {
|
||||||
return await this.redis.xtrim(streamKey, 'MAXLEN', '~', maxLength);
|
return await this.redis.xtrim(streamKey, 'MAXLEN', '~', maxLength);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(`Failed to trim stream: ${eventType}`, { error });
|
this.logger.error(`Failed to trim stream: ${eventType}`, error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -537,7 +537,7 @@ export class EventBus extends EventEmitter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(`Error replaying event: ${event.id}`, { error });
|
this.logger.error(`Error replaying event: ${event.id}`, error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -135,8 +135,12 @@ export class Logger {
|
||||||
this.log('warn', message, metadata);
|
this.log('warn', message, metadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
error(message: string | object, metadata?: LogMetadata & { error?: any }): void {
|
error(message: string | object, metadata?: LogMetadata & { error?: any } | unknown): void {
|
||||||
const data = { ...metadata };
|
// If metadata is an Error, normalize it
|
||||||
|
if(metadata instanceof Error){
|
||||||
|
metadata = { error: metadata };
|
||||||
|
}
|
||||||
|
const data = typeof metadata === 'object' ? { ...metadata } : { error: message } as any;
|
||||||
|
|
||||||
// Handle any type of error automatically
|
// Handle any type of error automatically
|
||||||
if (data.error) {
|
if (data.error) {
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,9 @@ describe('Advanced Logger Features', () => {
|
||||||
const logs = loggerTestHelpers.getCapturedLogs();
|
const logs = loggerTestHelpers.getCapturedLogs();
|
||||||
expect(logs.length).toBe(1);
|
expect(logs.length).toBe(1);
|
||||||
expect(logs[0].context).toBe('batch processing');
|
expect(logs[0].context).toBe('batch processing');
|
||||||
}); it('should handle error objects with circular references', () => {
|
});
|
||||||
|
|
||||||
|
it('should handle error objects with circular references', () => {
|
||||||
const errorWithCircular: any = { name: 'CircularError', message: 'Circular reference error' };
|
const errorWithCircular: any = { name: 'CircularError', message: 'Circular reference error' };
|
||||||
// Create a simple circular reference
|
// Create a simple circular reference
|
||||||
errorWithCircular.self = errorWithCircular;
|
errorWithCircular.self = errorWithCircular;
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ describe('Basic Logger Tests', () => {
|
||||||
const error = new Error('Test error');
|
const error = new Error('Test error');
|
||||||
error.stack = 'Error stack trace';
|
error.stack = 'Error stack trace';
|
||||||
|
|
||||||
logger.error('Error test', { error });
|
logger.error('Error test', error);
|
||||||
|
|
||||||
const logs = loggerTestHelpers.getCapturedLogs();
|
const logs = loggerTestHelpers.getCapturedLogs();
|
||||||
expect(logs.length).toBe(1);
|
expect(logs.length).toBe(1);
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ describe('Logger Integration Tests', () => {
|
||||||
const error = new Error('Test error');
|
const error = new Error('Test error');
|
||||||
error.stack = 'Error stack trace';
|
error.stack = 'Error stack trace';
|
||||||
|
|
||||||
logger.error('Error occurred', { error });
|
logger.error('Error occurred', error);
|
||||||
|
|
||||||
const logs = loggerTestHelpers.getCapturedLogs();
|
const logs = loggerTestHelpers.getCapturedLogs();
|
||||||
expect(logs.length).toBe(1);
|
expect(logs.length).toBe(1);
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ export class PostgreSQLClient {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const executionTime = Date.now() - startTime;
|
const executionTime = Date.now() - startTime;
|
||||||
this.logger.error(`Query failed after ${executionTime}ms:`, {
|
this.logger.error(`Query failed after ${executionTime}ms:`, {
|
||||||
error: (error as Error).message,
|
error,
|
||||||
query: text,
|
query: text,
|
||||||
params
|
params
|
||||||
});
|
});
|
||||||
|
|
@ -320,8 +320,8 @@ export class PostgreSQLClient {
|
||||||
private setupErrorHandlers(): void {
|
private setupErrorHandlers(): void {
|
||||||
if (!this.pool) return;
|
if (!this.pool) return;
|
||||||
|
|
||||||
this.pool.on('error', (err) => {
|
this.pool.on('error', (error) => {
|
||||||
this.logger.error('PostgreSQL pool error:', err);
|
this.logger.error('PostgreSQL pool error:', error);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.pool.on('connect', () => {
|
this.pool.on('connect', () => {
|
||||||
|
|
|
||||||
|
|
@ -44,13 +44,13 @@ export class QuestDBHealthMonitor {
|
||||||
try {
|
try {
|
||||||
await this.performHealthCheck();
|
await this.performHealthCheck();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Health check failed', { error });
|
this.logger.error('Health check failed', error);
|
||||||
}
|
}
|
||||||
}, intervalMs);
|
}, intervalMs);
|
||||||
|
|
||||||
// Perform initial health check
|
// Perform initial health check
|
||||||
this.performHealthCheck().catch(error => {
|
this.performHealthCheck().catch(error => {
|
||||||
this.logger.error('Initial health check failed', { error });
|
this.logger.error('Initial health check failed', error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -362,7 +362,7 @@ export class QuestDBInfluxWriter {
|
||||||
if (attempt <= options.retryAttempts) {
|
if (attempt <= options.retryAttempts) {
|
||||||
await this.sleep(options.retryDelay * attempt); // Exponential backoff
|
await this.sleep(options.retryDelay * attempt); // Exponential backoff
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Failed to write to QuestDB after ${options.retryAttempts} attempts: ${error}`);
|
throw new Error(`Failed to write to QuestDB after ${options.retryAttempts} attempts: $error`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -380,7 +380,7 @@ export class QuestDBInfluxWriter {
|
||||||
try {
|
try {
|
||||||
await this.flush(options);
|
await this.flush(options);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Scheduled flush failed', { error });
|
this.logger.error('Scheduled flush failed', error);
|
||||||
}
|
}
|
||||||
}, options.flushInterval);
|
}, options.flushInterval);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ export class QuestDBSchemaManager {
|
||||||
await this.createTable(schema);
|
await this.createTable(schema);
|
||||||
this.logger.info(`Table ${tableName} created successfully`);
|
this.logger.info(`Table ${tableName} created successfully`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(`Failed to create table ${tableName}`, { error });
|
this.logger.error(`Failed to create table ${tableName}`, error);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -201,7 +201,7 @@ export class QuestDBSchemaManager {
|
||||||
await this.client.query(sql);
|
await this.client.query(sql);
|
||||||
this.logger.info(`Table ${tableName} dropped`);
|
this.logger.info(`Table ${tableName} dropped`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(`Failed to drop table ${tableName}`, { error });
|
this.logger.error(`Failed to drop table ${tableName}`, error);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -219,7 +219,7 @@ export class QuestDBSchemaManager {
|
||||||
|
|
||||||
return result.rows.length > 0 && result.rows[0].count > 0;
|
return result.rows.length > 0 && result.rows[0].count > 0;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(`Error checking if table exists: ${tableName}`, { error });
|
this.logger.error(`Error checking if table exists: ${tableName}`, error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -260,7 +260,7 @@ export class QuestDBSchemaManager {
|
||||||
const stats = await this.getTableStats(tableName);
|
const stats = await this.getTableStats(tableName);
|
||||||
this.logger.info(`Table ${tableName} stats`, stats);
|
this.logger.info(`Table ${tableName} stats`, stats);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(`Failed to optimize table ${tableName}`, { error });
|
this.logger.error(`Failed to optimize table ${tableName}`, error);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -280,7 +280,7 @@ export class QuestDBSchemaManager {
|
||||||
|
|
||||||
return result.rows[0] || {};
|
return result.rows[0] || {};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(`Failed to get table stats for ${tableName}`, { error });
|
this.logger.error(`Failed to get table stats for ${tableName}`, error);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -293,7 +293,7 @@ export class QuestDBSchemaManager {
|
||||||
await this.client.query(`TRUNCATE TABLE ${tableName}`);
|
await this.client.query(`TRUNCATE TABLE ${tableName}`);
|
||||||
this.logger.info(`Table ${tableName} truncated`);
|
this.logger.info(`Table ${tableName} truncated`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(`Failed to truncate table ${tableName}`, { error });
|
this.logger.error(`Failed to truncate table ${tableName}`, error);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ export class VectorEngine {
|
||||||
signals
|
signals
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Vectorized strategy execution failed', { error });
|
this.logger.error('Vectorized strategy execution failed', error);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -383,7 +383,7 @@ export class VectorEngine {
|
||||||
this.logger.info(`Running vectorized backtest for strategy: ${strategy.id}`);
|
this.logger.info(`Running vectorized backtest for strategy: ${strategy.id}`);
|
||||||
results[strategy.id] = await this.executeVectorizedStrategy(data, strategy.code);
|
results[strategy.id] = await this.executeVectorizedStrategy(data, strategy.code);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(`Backtest failed for strategy: ${strategy.id}`, { error });
|
this.logger.error(`Backtest failed for strategy: ${strategy.id}`, error);
|
||||||
// Continue with other strategies
|
// Continue with other strategies
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue