com um clique
debug-logging
Volatio debug logging convention with
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Volatio debug logging convention with
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Market data integrity rules — gap filling, look-forward bias prevention, and stock split handling. Use when writing or reviewing code that loads prices, fills missing data, computes returns, backtests strategies, or makes trading decisions. Applies across Python, TypeScript, SQL, and TimescaleDB.
Analyze Volatio debug logs from /tmp/volatio-debug/. Use when the user asks to check debug logs, analyze problems, or diagnose simulation issues.
Apply bottom-up systematic testing to a multi-layer system. Use when asked to test, debug, or verify a pipeline that spans multiple layers (e.g., Python worker → bridge → processor → API → UI).
Drizzle Kit workflow for Volatio using idempotent migrations (generate + edit + migrate), never use push. Idempotent patterns prevent partial failure issues, enable safe re-runs, and work cleanly in CI. Use when schema changes, migration errors, or database sync issues occur.
Template for creating Volatio research experiments with Optuna optimization and portfolio backtesting. Includes proper train/test splits, lookahead bias prevention, results saving, and validated patterns from Exp 051-053.
Financial research look-ahead bias verification for Volatio ML pipelines, mandatory baseline comparisons, timezone handling, feature leakage detection. Use when model accuracy seems too good or validating prediction experiments.
| name | debug-logging |
| description | Volatio debug logging convention with |
console.log(`[ClassName.methodName] description ${data} ${Date.now()} ######`);
[ClassName.methodName] - Exact location in code${Date.now()}###### marker for easy search/removalexport class EconomicEventsPersister {
async persist(events: Event[]): Promise<void> {
console.log(`[EconomicEventsPersister.persist] Starting with ${events.length} events ${Date.now()} ######`);
for (const event of events) {
console.log(`[EconomicEventsPersister.persist] Processing ${event.eventKey} ${Date.now()} ######`);
try {
await db.insert(economicEvents).values(event);
console.log(`[EconomicEventsPersister.persist] Inserted ${event.eventKey} ${Date.now()} ######`);
} catch (error) {
console.log(`[EconomicEventsPersister.persist] Failed ${event.eventKey}: ${error} ${Date.now()} ######`);
}
}
console.log(`[EconomicEventsPersister.persist] Complete ${Date.now()} ######`);
}
}
ALWAYS show ALL logs - never hide output:
# ✅ GOOD: Show everything
bun script.ts 2>&1
# ✅ GOOD: Show output AND save to file
bun script.ts 2>&1 | tee debug.log
# ❌ BAD: Hiding output
bun script.ts > /dev/null 2>&1
bun script.ts --silent
# Find all debug logs
grep '######' output.log
# Find specific class/method
grep '\[ClassName.methodName\]' output.log
# Find in real-time
bun script.ts 2>&1 | grep --line-buffered '######'
Remove ALL debug logs when done:
# Find all files with debug markers
grep -r '######' packages/
# Remove all lines with ######
grep -r '######' packages/ --files-with-matches | xargs sed -i '' '/######/d'
// ❌ BAD: Leaves empty blocks
try {
console.log(`[Class.method] debug ${Date.now()} ######`);
await someOperation();
} catch (error) {
console.log(`[Class.method] error ${Date.now()} ######`);
}
// ✅ GOOD: Remove empty blocks entirely
await someOperation();
Rules for cleanup:
| Type | Purpose | Format | Persistence |
|---|---|---|---|
| Debug Logs | Temporary debugging | console.log(...) ###### | Remove after fix |
| Production Logs | Permanent observability | logger.info(...) | Keep forever |
For permanent observability, use @volatio/shared/logger:
import { logger, createJobLogger, metrics } from '@volatio/shared/logger';
// Base logger
logger.info({ port: 3001 }, 'Server started');
// Job-specific logger
const log = createJobLogger(job.id, 'yahoo-discovery');
log.info({ articles: 50 }, 'Discovery complete');
// Metrics
metrics.discoveryComplete({
source: 'yahoo',
totalFound: 100,
durationMs: 3200,
});
###### logs - they're temporary only