← Index
Source: docs/issues/issue-93-implement-structured-logging-with-error-levels-debug-info-wa.md (auto-generated by scripts/generate-docs-html.mjs — edit the .md, not this file)

Implement structured logging with error levels (debug, info, warn, error)

Issue #93 | State: CLOSED | Created: 2026-01-26T08:32:00Z

Assignees: linked0, Abdulkarim4u

Updated: 2026-02-02T08:05:04Z | Closed: 2026-02-02T08:05:04Z


Description

Problem

Currently, the application uses inconsistent logging with basic console.log() and console.error() statements. This makes it difficult to:

Proposed Solution

Implement a structured logging system with standardized log levels and formatting.

Log Levels

  1. DEBUG - Detailed information for diagnosing problems (dev only)
  2. INFO - General informational messages (service started, config loaded)
  3. WARN - Warning messages for potentially harmful situations
  4. ERROR - Error events that might still allow the app to continue
  5. FATAL - Severe errors that cause application termination

Features

Example Usage

// Before
console.log('User placed order:', orderId);
console.error('Failed to execute trade:', error);

// After
logger.info('User placed order', { orderId, userId, marketId });
logger.error('Failed to execute trade', { error: error.message, orderId, txHash });
logger.debug('Market maker bot checking prices', { outcomeId, currentPrice });
logger.warn('High gas price detected', { gasPrice, threshold });

Suggested Libraries