本文整理汇总了TypeScript中fancy-log.default方法的典型用法代码示例。如果您正苦于以下问题:TypeScript fancy-log.default方法的具体用法?TypeScript fancy-log.default怎么用?TypeScript fancy-log.default使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fancy-log
的用法示例。
在下文中一共展示了fancy-log.default方法的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);
}
};
示例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')}`);
}
示例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');
}
});
示例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');
});
示例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);
}
});
示例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]);
}
});
示例7: onStart
function onStart(): void {
if (count++ > 0) {
return;
}
startTime = new Date().getTime();
fancyLog(`Starting ${ansiColors.green('compilation')}...`);
}
示例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();
};
示例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}`);
});
示例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();
}
});