Nog CLI Developer Guide - v0.10.5
    Preparing search index...

    Class Logger

    Global Logger utility for the CLI. Wraps standard console methods to provide consistent, color-coded formatting and log levels.

    It handles output streams correctly:

    • stdout: for INFO and DEBUG messages.
    • stderr: for WARN and ERROR messages.
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Logs a debug message to stdout, ONLY if the DEBUG environment variable is set. Use this for internal developer details useful for troubleshooting logic (e.g., "Parsed IR model state:", object dumps).

      Color: Gray tag [DEBUG]

      Parameters

      • message: string

        The debug note.

      • ...optionalArgs: unknown[]

        Raw objects or arrays for deep inspection.

      Returns void

    • Logs an error message to stderr. Use this for critical failures that prevent an operation from completing (e.g., "Failed to parse schema", "Network timeout").

      Color: Red tag [ERROR]

      Parameters

      • message: string

        The error message.

      • ...optionalArgs: unknown[]

        Error objects, stack traces, or detailed failure info.

      Returns void

    • Logs a general informational message to stdout. Use this for standard feedback to the user (e.g., "File created successfully").

      Color: Cyan tag [INFO]

      Parameters

      • message: string

        The main message to log.

      • ...optionalArgs: unknown[]

        Additional arguments, objects, or arrays to inspect.

      Returns void

    • Logs a warning message to stderr. Use this for non-critical issues or potential problems that do not halt execution (e.g., "Configuration file missing, using defaults").

      Color: Yellow tag [WARN]

      Parameters

      • message: string

        The warning message.

      • ...optionalArgs: unknown[]

        Additional context or data.

      Returns void