no idea- added loki and other stuff to market-data-gateway, also added config lib

This commit is contained in:
Bojan Kucera 2025-06-03 11:37:58 -04:00
parent b957fb99aa
commit 1b71fc87ab
72 changed files with 6178 additions and 153 deletions

View file

@ -0,0 +1,34 @@
#!/usr/bin/env bun
/**
* Test script to verify the Loki logging integration
*/
import { Logger, LogLevel } from '@stock-bot/utils';
// Create a logger for testing
const logger = new Logger('test-service', LogLevel.DEBUG);
// Log test messages
logger.info('Starting test log messages...');
logger.debug('This is a DEBUG level message');
logger.info('This is an INFO level message');
logger.warn('This is a WARNING level message');
logger.error('This is an ERROR level message');
// Add some structured data
logger.info('Processing trade', { symbol: 'AAPL', price: 190.50, quantity: 100 });
logger.info('Processing trade', { symbol: 'MSFT', price: 410.75, quantity: 50 });
// Simulate an error
try {
throw new Error('This is a simulated error');
} catch (error) {
logger.error('An error occurred', error);
}
logger.info('Test log messages complete. Check Grafana at http://localhost:3000 to view logs.');
// Wait to ensure all logs are sent
setTimeout(() => {
process.exit(0);
}, 1000);