How to use the @statusfy/common.logger.info function in @statusfy/common

To help you get started, we’ve selected a few @statusfy/common 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 bazzite / statusfy / packages / @statusfy / core / lib / init.js View on Github external
// Avoid overwrite user files
  const checkFiles = ["package.json", "config.js", "config.yml", "config.toml"];

  checkFiles.forEach(file => {
    if (fs.existsSync(path.join(outDir, file))) {
      logger.error(`Make sure your destination directory is empty.\n${outDir}`);
      process.exit(0);
    }
  });

  // Prompt questions
  if (fs.existsSync(outDir) && fs.readdirSync(outDir).length > 0) {
    logger.warn("Remember to make sure your destination directory is empty.");
  }

  logger.info("Please answer the following questions:");

  inquirer.prompt(questions).then(answers => {
    const languageInfo = localeCode.getLanguages([answers.lang])[0];
    const config = JSON.parse(
      configTemplate({
        options: {
          title: answers.title,
          name: slugify(answers.title),
          description: answers.description,
          language: {
            code: languageInfo.code.split("-")[0],
            iso: languageInfo.code,
            name: languageInfo.nativeName
          },
          frontMatterFormat: answers.incidentFormat
        }
github bazzite / statusfy / packages / @statusfy / core / server / index.js View on Github external
return app.listen(port, host, () => {
    // Listen the server
    logger.info(`Server listening on http://${host}:${port}`);
  });
};
github bazzite / statusfy / packages / @statusfy / core / lib / config / generate.js View on Github external
"styl",
    "stylus"
  ];
  const stylesPath = [];

  // eslint-disable-next-line no-unused-vars
  for (const ext of validStylesExtension) {
    const filePath = path.join(sourceDir, "theme", "default", `style.${ext}`);

    if (fs.existsSync(filePath)) {
      stylesPath.push(filePath);
    }
  }

  if (stylesPath.length > 0) {
    logger.info(
      `Loading Styles from:\n${stylesPath
        .map(p => path.relative(sourceDir, p))
        .join("\n")}`
    );

    nuxtConfig.css.push(...stylesPath);
  }

  return {
    nuxtConfig,
    siteConfig
  };
};
github bazzite / statusfy / packages / @statusfy / core / lib / dev.js View on Github external
.on("restart", files => {
      logger.info(`Restarting Server due to changes in:\n${files.join("\n")}`);
    })
    .on("crash", () => {
github bazzite / statusfy / packages / @statusfy / core / lib / config / load.js View on Github external
function parseConfig(filePath) {
  const extension = path.extname(filePath);
  let data;

  logger.info(
    `Reading configuration from ${chalk.yellow(`config${extension}`)}`
  );

  if (extension !== ".js") {
    const content = fse.readFileSync(filePath, "utf-8");

    if (extension === ".yml") {
      data = yaml.parse(content);
    } else if (extension === ".toml") {
      data = toml.parse(content);
    }
  } else {
    data = require(filePath);
  }

  return data || {};