Function createArrayLogger

  • Creates a custom logger that doesn't actually log but stores the logs into a object for later usage. This is particularly useful in tests.

    Parameters

    Returns {
        log: Logger;
        logs: {
            stderr: string[];
            stdout: string[];
        };
    }

    • log: Logger
    • logs: {
          stderr: string[];
          stdout: string[];
      }
      • stderr: string[]
      • stdout: string[]
    import {createArrayLogger} from '@augment-vir/common';

    const {log, logs} = createArrayLogger();

    log.info('hi');
    // `logs[LogOutputType.Standard]` is now `['hi']`