GeoLeaf Core API - v3.0.0
    Preparing search index...

    Interface LogImplInterface

    The shape of GeoLeaf.Log — a level-filtered console with repetition damping.

    Two independent mechanisms decide whether a call reaches the console: the level threshold (LogImplInterface.setLevel) and, for messages recognised as repetitive, a grouping counter that suppresses them after a few occurrences and reports the totals through LogImplInterface.showSummary. A message can therefore be dropped even at a permissive level.

    interface LogImplInterface {
        setLevel(level: string): void;
        getLevel(): number;
        getLevelName(): string;
        setQuietMode(enabled: boolean): void;
        showSummary(): void;
        debug(...args: unknown[]): void;
        info(...args: unknown[]): void;
        warn(...args: unknown[]): void;
        error(...args: unknown[]): void;
    }
    Index

    Methods

    • Sets the verbosity threshold.

      Accepts "debug", "info", "warn", "error" and "production", case-insensitively. ⚠️ "production" is not a level of its own: it sets the threshold to warn and turns quiet mode on, so it is the only value with a side effect beyond the threshold. An unrecognised value logs a warning and leaves the level unchanged.

      Parameters

      • level: string

        The level name.

      Returns void

      GeoLeaf.Log.setLevel("debug");
      
      GeoLeaf.Log.setLevel("production");
      // Équivalent à : setLevel('warn') + setQuietMode(true)
    • The current threshold, as its numeric value from LEVELS.

      Returns number

      0 (DEBUG), 1 (INFO), 2 (WARN) or 3 (ERROR).

      const level = GeoLeaf.Log.getLevel();
      // Returns: 0 (DEBUG) | 1 (INFO) | 2 (WARN) | 3 (ERROR)
    • The current threshold, as its name.

      ⚠️ Reports the threshold, not the mode: after setLevel("production") this returns "WARN", and nothing here reveals that quiet mode was switched on with it.

      Returns string

      "DEBUG", "INFO", "WARN" or "ERROR".

      const name = GeoLeaf.Log.getLevelName();
      // Returns: 'DEBUG' | 'INFO' | 'WARN' | 'ERROR'
    • Turns repetition damping on or off, independently of the level.

      With it on, messages matching the module's repetitive-message patterns are shown a couple of times and then counted silently until LogImplInterface.showSummary.

      Parameters

      • enabled: boolean

        true to damp repetitive messages.

      Returns void

      GeoLeaf.Log.setQuietMode(true);
      // [GeoLeaf.INFO] Silent mode activated - repetitive logs reduced
    • Prints how many times each damped message was suppressed.

      The counterpart of quiet mode: without this call, the suppressed occurrences are never reported at all.

      Returns void

      GeoLeaf.Log.showSummary();
      // [GeoLeaf.INFO] Grouped log summary
      // • 12x: Module loaded...
      // • 8x: Profile loaded...
    • Logs at DEBUG — internal detail, off by default (the default threshold is INFO).

      Parameters

      • ...args: unknown[]

        Values forwarded to the console, prefixed with the module tag.

      Returns void

      GeoLeaf.Log.debug("[GeoLeaf.GeoJSON] Chargement des entités…");
      
    • Logs at INFO — normal lifecycle events. Subject to repetition damping.

      Parameters

      • ...args: unknown[]

        Values forwarded to the console, prefixed with the module tag.

      Returns void

      GeoLeaf.Log.info("[GeoLeaf.Core] Carte initialisée.");
      
    • Logs at WARN — a degraded path was taken, but the operation continued.

      Parameters

      • ...args: unknown[]

        Values forwarded to the console, prefixed with the module tag.

      Returns void

      GeoLeaf.Log.warn("[GeoLeaf.Config] Clé 'basemap.id' manquante, fallback sur 'street'.");
      
    • Logs at ERROR — the highest level, never damped by quiet mode.

      Parameters

      • ...args: unknown[]

        Values forwarded to the console, prefixed with the module tag.

      Returns void

      GeoLeaf.Log.error("[GeoLeaf.Config] Échec du chargement de la configuration.");