Metreeca Wire
    Preparing search index...
    • Wraps a Repository to log each operation and its elapsed time.

      Returns a repository that delegates every operation to repository, timing each one and reporting it through logger: queries and updates log the elapsed milliseconds alongside the request text, whether issued directly or through the transaction scope handed to an execute task, while execute additionally logs the transaction opening, its committed duration, or its abort with the propagated error. The wrapper is otherwise transparent: results, errors, and isolation guarantees are those of the wrapped repository.

      Parameters

      • repository: Repository

        The repository to wrap

      • logger: (message: string) => void

        The callback invoked with each log message

      Returns Repository

      An immutable Repository that delegates to repository while logging operation timings