removed deprecated createLogger and replaced with getLogger
This commit is contained in:
parent
5d8b102422
commit
c10a524aa8
29 changed files with 93 additions and 136 deletions
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* Data Service - Combined live and historical data ingestion
|
||||
*/
|
||||
import { createLogger } from '@stock-bot/logger';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import { loadEnvVariables } from '@stock-bot/config';
|
||||
import { Hono } from 'hono';
|
||||
import { serve } from '@hono/node-server';
|
||||
|
|
@ -10,7 +10,7 @@ import { serve } from '@hono/node-server';
|
|||
loadEnvVariables();
|
||||
|
||||
const app = new Hono();
|
||||
const logger = createLogger('data-service');
|
||||
const logger = getLogger('data-service');
|
||||
|
||||
const PORT = parseInt(process.env.DATA_SERVICE_PORT || '3002');
|
||||
// Health check endpoint
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
/**
|
||||
* Unified data interface for live and historical data
|
||||
*/
|
||||
import { createLogger } from '@stock-bot/logger';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import { QuestDBClient } from '@stock-bot/questdb-client';
|
||||
import { EventBus } from '@stock-bot/event-bus';
|
||||
|
||||
const logger = createLogger('unified-data-provider');
|
||||
const logger = getLogger('unified-data-provider');
|
||||
|
||||
export interface MarketData {
|
||||
symbol: string;
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ export class ProxyService {
|
|||
private logger = new Logger('proxy-service');
|
||||
private cache: CacheProvider = createCache('hybrid');
|
||||
private httpClient: HttpClient;
|
||||
private readonly concurrencyLimit = pLimit(200);
|
||||
private readonly concurrencyLimit = pLimit(250);
|
||||
private readonly CACHE_KEY = 'proxy';
|
||||
private readonly CACHE_TTL = 86400; // 24 hours
|
||||
private readonly CHECK_TIMEOUT = 7000;
|
||||
private readonly CHECK_TIMEOUT = 5000;
|
||||
private readonly CHECK_IP = '99.246.102.205'
|
||||
private readonly CHECK_URL = 'https://proxy-detection.stare.gg/?api_key=bd406bf53ddc6abe1d9de5907830a955';
|
||||
private readonly PROXY_SOURCES = [
|
||||
|
|
@ -164,7 +164,7 @@ export class ProxyService {
|
|||
*/
|
||||
async checkProxy(proxy: ProxyInfo): Promise<ProxyInfo> {
|
||||
let success = false;
|
||||
this.logger.debug('Checking Proxy : ', {
|
||||
this.logger.debug(`Checking Proxy with ${this.concurrencyLimit.pendingCount } pending: `, {
|
||||
protocol: proxy.protocol,
|
||||
host: proxy.host,
|
||||
port: proxy.port,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Order } from '@stock-bot/types';
|
||||
import { createLogger } from '@stock-bot/logger';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
|
||||
export interface RiskRule {
|
||||
name: string;
|
||||
|
|
@ -21,7 +21,7 @@ export interface RiskValidationResult {
|
|||
}
|
||||
|
||||
export class RiskManager {
|
||||
private logger = createLogger('risk-manager');
|
||||
private logger = getLogger('risk-manager');
|
||||
private rules: RiskRule[] = [];
|
||||
|
||||
constructor() {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { Hono } from 'hono';
|
||||
import { serve } from '@hono/node-server';
|
||||
import { createLogger } from '@stock-bot/logger';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import { config } from '@stock-bot/config';
|
||||
// import { BrokerInterface } from './broker/interface.ts';
|
||||
// import { OrderManager } from './execution/order-manager.ts';
|
||||
// import { RiskManager } from './execution/risk-manager.ts';
|
||||
|
||||
const app = new Hono();
|
||||
const logger = createLogger('execution-service');
|
||||
const logger = getLogger('execution-service');
|
||||
// Health check endpoint
|
||||
app.get('/health', (c) => {
|
||||
return c.json({
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { Hono } from 'hono';
|
||||
import { serve } from '@hono/node-server';
|
||||
import { createLogger } from '@stock-bot/logger';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import { config } from '@stock-bot/config';
|
||||
import { PortfolioManager } from './portfolio/portfolio-manager.ts';
|
||||
import { PerformanceAnalyzer } from './analytics/performance-analyzer.ts';
|
||||
|
||||
const app = new Hono();
|
||||
const logger = createLogger('portfolio-service');
|
||||
const logger = getLogger('portfolio-service');
|
||||
// Health check endpoint
|
||||
app.get('/health', (c) => {
|
||||
return c.json({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { createLogger } from '@stock-bot/logger';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
|
||||
export interface Position {
|
||||
symbol: string;
|
||||
|
|
@ -34,7 +34,7 @@ export interface Trade {
|
|||
}
|
||||
|
||||
export class PortfolioManager {
|
||||
private logger = createLogger('PortfolioManager');
|
||||
private logger = getLogger('PortfolioManager');
|
||||
private positions: Map<string, Position> = new Map();
|
||||
private trades: Trade[] = [];
|
||||
private cashBalance: number = 100000; // Starting cash
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* Processing Service - Technical indicators and data processing
|
||||
*/
|
||||
import { createLogger } from '@stock-bot/logger';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import { loadEnvVariables } from '@stock-bot/config';
|
||||
import { Hono } from 'hono';
|
||||
import { serve } from '@hono/node-server';
|
||||
|
|
@ -10,7 +10,7 @@ import { serve } from '@hono/node-server';
|
|||
loadEnvVariables();
|
||||
|
||||
const app = new Hono();
|
||||
const logger = createLogger('processing-service');
|
||||
const logger = getLogger('processing-service');
|
||||
const PORT = parseInt(process.env.PROCESSING_SERVICE_PORT || '3003');
|
||||
|
||||
// Health check endpoint
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
* Technical Indicators Service
|
||||
* Leverages @stock-bot/utils for calculations
|
||||
*/
|
||||
import { createLogger } from '@stock-bot/logger';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import {
|
||||
sma,
|
||||
ema,
|
||||
|
|
@ -10,7 +10,7 @@ import {
|
|||
macd
|
||||
} from '@stock-bot/utils';
|
||||
|
||||
const logger = createLogger('indicators-service');
|
||||
const logger = getLogger('indicators-service');
|
||||
|
||||
export interface IndicatorRequest {
|
||||
symbol: string;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { createLogger } from '@stock-bot/logger';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import { EventBus } from '@stock-bot/event-bus';
|
||||
import { VectorEngine, VectorizedBacktestResult } from '@stock-bot/vector-engine';
|
||||
import { DataFrame } from '@stock-bot/data-frame';
|
||||
|
|
@ -43,7 +43,7 @@ export class HybridMode extends ExecutionMode {
|
|||
this.eventMode = new EventMode(context, eventBus);
|
||||
this.vectorizedMode = new VectorizedMode(context, eventBus);
|
||||
|
||||
this.logger = createLogger('hybrid-mode');
|
||||
this.logger = getLogger('hybrid-mode');
|
||||
}
|
||||
|
||||
async initialize(): Promise<void> {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { createLogger } from '@stock-bot/logger';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import { EventBus } from '@stock-bot/event-bus';
|
||||
import { VectorEngine, VectorizedBacktestResult } from '@stock-bot/vector-engine';
|
||||
import { DataFrame } from '@stock-bot/data-frame';
|
||||
|
|
@ -13,7 +13,7 @@ export interface VectorizedModeConfig {
|
|||
export class VectorizedMode extends ExecutionMode {
|
||||
private vectorEngine: VectorEngine;
|
||||
private config: VectorizedModeConfig;
|
||||
private logger = createLogger('vectorized-mode');
|
||||
private logger = getLogger('vectorized-mode');
|
||||
|
||||
constructor(
|
||||
context: BacktestContext,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
import { program } from 'commander';
|
||||
import { createLogger } from '@stock-bot/logger';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import { createEventBus } from '@stock-bot/event-bus';
|
||||
import { BacktestContext } from '../framework/execution-mode';
|
||||
import { LiveMode } from '../backtesting/modes/live-mode';
|
||||
|
|
@ -13,7 +13,7 @@ import { EventMode } from '../backtesting/modes/event-mode';
|
|||
import VectorizedMode from '../backtesting/modes/vectorized-mode';
|
||||
import HybridMode from '../backtesting/modes/hybrid-mode';
|
||||
|
||||
const logger = createLogger('strategy-cli');
|
||||
const logger = getLogger('strategy-cli');
|
||||
|
||||
interface CLIBacktestConfig {
|
||||
strategy: string;
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
* Execution Mode Framework
|
||||
* Base classes for different execution modes (live, event-driven, vectorized)
|
||||
*/
|
||||
import { createLogger } from '@stock-bot/logger';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
|
||||
const logger = createLogger('execution-mode');
|
||||
const logger = getLogger('execution-mode');
|
||||
|
||||
export interface Order {
|
||||
id: string;
|
||||
|
|
@ -38,7 +38,7 @@ export interface MarketData {
|
|||
}
|
||||
|
||||
export abstract class ExecutionMode {
|
||||
protected logger = createLogger(this.constructor.name);
|
||||
protected logger = getLogger(this.constructor.name);
|
||||
|
||||
abstract name: string;
|
||||
abstract executeOrder(order: Order): Promise<OrderResult>;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* Strategy Service - Multi-mode strategy execution and backtesting
|
||||
*/
|
||||
import { createLogger } from '@stock-bot/logger';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import { loadEnvVariables } from '@stock-bot/config';
|
||||
import { Hono } from 'hono';
|
||||
import { serve } from '@hono/node-server';
|
||||
|
|
@ -10,7 +10,7 @@ import { serve } from '@hono/node-server';
|
|||
loadEnvVariables();
|
||||
|
||||
const app = new Hono();
|
||||
const logger = createLogger('strategy-service');
|
||||
const logger = getLogger('strategy-service');
|
||||
const PORT = parseInt(process.env.STRATEGY_SERVICE_PORT || '3004');
|
||||
|
||||
// Health check endpoint
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue