How to use the backfill-logger.logger.setCacheProvider 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 / index.ts View on Github external
buildCommand: BuildCommand,
  hasher: IHasher
): Promise {
  const {
    cacheStorageConfig,
    outputFolder,
    name,
    mode,
    logFolder,
    producePerformanceLogs,
    validateOutput
  } = config;

  logger.setName(name);
  logger.setMode(mode);
  logger.setCacheProvider(cacheStorageConfig.provider);

  const createPackageHash = async () => await hasher.createPackageHash();
  const fetch = async (hash: string) =>
    await cacheStorage.fetch(hash, outputFolder);
  const run = async () => {
    try {
      await buildCommand();
    } catch (err) {
      throw new Error(`Command failed with the following error:\n\n${err}`);
    }
  };
  const put = async (hash: string) => {
    try {
      await cacheStorage.put(hash, outputFolder);
    } catch (err) {
      logger.error(