How to use the faastjs.log.info function in faastjs

To help you get started, we’ve selected a few faastjs 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 teppeis / duck / src / batch.ts View on Github external
CommonOptions,
  faastAws,
  faastLocal,
  FaastModuleProxy,
  LocalOptions,
  log,
} from "faastjs";
import mergeOptions from "merge-options";
import semver from "semver";
import { assertNonNullable } from "./assert";
import * as compilerFaastFunctions from "./compiler-core";
import { DuckConfig } from "./duckconfig";
import { logger } from "./logger";

// change to stdout
log.info.log = console.log.bind(console);

export async function getFaastCompiler(
  config: DuckConfig
): Promise> {
  logger.info("Initializing batch mode");
  const batch = assertNonNullable(config.batch);
  const batchOptions = getBatchOptions(config);
  const m =
    batch === "aws"
      ? await faastAws(compilerFaastFunctions, batchOptions as AwsOptions)
      : batch === "local"
      ? await faastLocal(compilerFaastFunctions, batchOptions as LocalOptions)
      : null;
  if (!m) {
    throw new TypeError(`Unsupported batch mode: ${batch}`);
  }