當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript fancy-log類代碼示例

本文整理匯總了TypeScript中fancy-log的典型用法代碼示例。如果您正苦於以下問題:TypeScript fancy-log類的具體用法?TypeScript fancy-log怎麽用?TypeScript fancy-log使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了fancy-log類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: join

export = (done: any) => {

  const checkFile = join(process.cwd(), 'tools', 'config.js');

  // need to require the build.toolchain task as it won't be able to run after we run clear.files
  const buildTools = require('./build.tools');
  const cleanTools = require('./clean.tools');

  let rebuild = false;

  try {
    fs.accessSync(checkFile, fs.F_OK);
    log('Gulpfile has previously been compiled, rebuilding toolchain');
    rebuild = true;

  } catch (e) {
    log('Tools not compiled, skipping rebuild');
    done();
  }

  // continue here to prevent other errors being caught...
  if (rebuild) {
    log('Running \'clean.tools\' from check.tools');
    cleanTools();

    log('Running \'build.tools\' from check.tools');
    const build = buildTools();

    build.on('end', done);
  }

};
開發者ID:albogdano,項目名稱:angular2-para,代碼行數:32,代碼來源:check.tools.ts

示例2: log

function log(): void {
	const errors = _.flatten(allErrors);
	const seen = new Set<string>();

	errors.map(err => {
		if (!seen.has(err)) {
			seen.add(err);
			fancyLog(`${ansiColors.red('Error')}: ${err}`);
		}
	});

	const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
	const messages = errors
		.map(err => regex.exec(err))
		.filter(match => !!match)
		.map(x => x as string[])
		.map(([, path, line, column, message]) => ({ path, line: parseInt(line), column: parseInt(column), message }));

	try {

		fs.writeFileSync(buildLogPath, JSON.stringify(messages));
	} catch (err) {
		//noop
	}

	fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime!) + ' ms')}`);
}
開發者ID:PKRoma,項目名稱:vscode,代碼行數:27,代碼來源:reporter.ts

示例3: exec

 exec(`${sw} ${Config.APP_DEST} ${src}`, function(error: Error, stdout: any, stderr: any) {
   if (error !== null) {
     reportError('Angular Service Worker config error: ' + error + stderr);
   } else {
     log('Angular Service Worker config success');
   }
 });
開發者ID:albogdano,項目名稱:angular2-para,代碼行數:7,代碼來源:sw.manifest.static.ts

示例4: function

	}, function () {
		if (log) {
			if (entry.totalCount === 1) {
				fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);

			} else {
				const count = entry.totalCount < 100
					? ansiColors.green(entry.totalCount.toString())
					: ansiColors.red(entry.totalCount.toString());

				fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
			}
		}

		this.emit('end');
	});
開發者ID:PKRoma,項目名稱:vscode,代碼行數:16,代碼來源:stats.ts

示例5: validateTasks

 .forEach(([tasks, file]: [string, string]) => {
   const invalid = validateTasks(tasks);
   if (invalid.length) {
     const errorMessage = getInvalidTaskErrorMessage(invalid, file);
     log(colors.red(errorMessage));
     process.exit(1);
   }
 });
開發者ID:albogdano,項目名稱:angular2-para,代碼行數:8,代碼來源:tasks_tools.ts

示例6: existsSync

 .forEach((key: string) => {
   if (key === 'lang') {
     const lang: string = namedArgs[key] as string;
     const i18nFilePath = `${Config.LOCALE_DEST}/messages.${lang}.xlf`;
     const isExists = existsSync(i18nFilePath);
     if (isExists) {
       args.push('--i18nFile', i18nFilePath);
       args.push('--locale', lang);
       args.push('--i18nFormat', 'xlf');
     } else {
       log(colors.gray('Translation file is not found'), colors.yellow(i18nFilePath));
       log(colors.gray(`Use 'npm run i18n' command to create your translation file`));
     }
   } else {
     args.push('--' + key, namedArgs[key]);
   }
 });
開發者ID:albogdano,項目名稱:angular2-para,代碼行數:17,代碼來源:compile.ahead.prod.ts

示例7: onStart

function onStart(): void {
	if (count++ > 0) {
		return;
	}

	startTime = new Date().getTime();
	fancyLog(`Starting ${ansiColors.green('compilation')}...`);
}
開發者ID:PKRoma,項目名稱:vscode,代碼行數:8,代碼來源:reporter.ts

示例8: log

export = (done: any) => {
  log(colors.yellow(`
    Warning!
    Please use ${colors.green('npm run build.prod')}
    Instead of ${colors.red('npm run build.prod.aot')} or ${colors.red('npm run build.prod.aot')}
    They will be deleted soon!`));

  done();
};
開發者ID:albogdano,項目名稱:angular2-para,代碼行數:9,代碼來源:deprecate.notification.ts

示例9: require

    files.forEach((file) => {
        const cmdFile = require(`./commands/${file}`);
        const cmdFileName = file.split(".")[0];

        const cmdClass = new cmdFile[cmdFileName]();
        app.telegram.command(cmdClass.aliases, cmdClass.execute);

        log(`Commandhandler loaded: ${cmdFileName}`);
    });
開發者ID:HumaneWolf,項目名稱:nfc-helperbot,代碼行數:9,代碼來源:bot.ts

示例10: runSequence

gulp.task('clean.once', (done: any) => {
  if (firstRun) {
    firstRun = false;
    runSequence('check.tools', 'clean.dev', 'clean.coverage', done);
  } else {
    log('Skipping clean on rebuild');
    done();
  }
});
開發者ID:albogdano,項目名稱:angular2-para,代碼行數:9,代碼來源:gulpfile.ts


注:本文中的fancy-log類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。