nirs4all.core.logging.formatters module

Console and file formatters for nirs4all logging.

This module provides formatters for human-readable console output and structured file logging, with ASCII and Unicode mode support.

nirs4all.core.logging.formatters.format_number(value: float | int, precision: int = 3) → str[source]

Format a number for display.

Uses thousands separators for large integers and appropriate precision for floats.

Parameters:
  • value – Number to format.

  • precision – Decimal precision for floats.

Returns:

Formatted number string.

nirs4all.core.logging.formatters.format_table(headers: list[str], rows: list[list[str]], use_unicode: bool = True) → str[source]

Format a simple ASCII table.

Parameters:
  • headers – Column headers.

  • rows – Table rows (list of lists).

  • use_unicode – Unused, kept for API consistency.

Returns:

Formatted table string.

nirs4all.core.logging.formatters.get_symbols() → Symbols[source]

Get the global symbols instance.