Skip to content

Replace console.* usage with project logger for consistent logging #433

@pedroanastacio

Description

@pedroanastacio

Context

Some parts of the codebase still rely on direct console.* calls (console.warn, console.error, console.log, etc.) to report errors and runtime information.
Although this works during development, it may not be ideal for production.

Problem

Using console.* directly:

  • Bypasses the project's logging abstraction
  • May not be properly captured by production monitoring and log aggregation tools
  • Leads to inconsistent log formats and missing contextual metadata
  • Makes observability and debugging harder in production environments

Suggestion

Replace direct console.* calls with the project’s logger instance to ensure structured, consistent, and observable logs.

Example:

logger.warn(`Failed to get balances for vault ${vaultId}`, {
  error: err?.message,
  vaultId,
});

The same approach should be applied for other log levels such as error, info, or debug, depending on the context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions