How to use the backfill-logger.logger.setHash function in backfill-logger

To help you get started, we’ve selected a few backfill-logger examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / backfill / packages / backfill / src / hasher.ts View on Github external
hashOfOwnFiles,
      hashOfLockFile
    ])
      .then(hashes => hashes.filter(notEmpty))
      .then(hashes => createHash(hashes));

    logger.profile("hasher:calculateHash");

    // 2. Create hash to be stored in the package. Used to communicate the state
    // of the package to dependent packages (parents)
    await Promise.all([...hashOfDependencies, hashOfOwnFiles, hashOfLockFile])
      .then(hashes => hashes.filter(notEmpty))
      .then(hashes => createHash(hashes))
      .then(hash => this.writeHashToDisk(hash));

    logger.setHash(packageHash);
    return packageHash;
  }
}
github microsoft / backfill / packages / hasher / src / index.ts View on Github external
done.push(packageHash);
    }

    const internalPackagesHash = generateHashOfInternalPackages(done);
    const buildCommandHash = await hashStrings(this.buildCommandSignature);
    const combinedHash = await hashStrings([
      internalPackagesHash,
      buildCommandHash
    ]);

    logger.verbose(`Hash of internal packages: ${internalPackagesHash}`);
    logger.verbose(`Hash of build command: ${buildCommandHash}`);
    logger.verbose(`Combined hash: ${combinedHash}`);

    logger.profile("hasher:calculateHash");
    logger.setHash(combinedHash);

    return combinedHash;
  }