• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript fancy-log类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript fetch-jsonp类代码示例发布时间:2022-05-28
下一篇:
TypeScript extend类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap