本文整理汇总了TypeScript中loge.logger.info方法的典型用法代码示例。如果您正苦于以下问题:TypeScript logger.info方法的具体用法?TypeScript logger.info怎么用?TypeScript logger.info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类loge.logger
的用法示例。
在下文中一共展示了logger.info方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: callback
.execute((error: Error, rows: {name: string, average: number}[]) => {
if (error) return callback(error)
logger.info('averaged downloads for %d packages', rows.length)
const packages: {[index: string]: number} = {}
rows.forEach(row => packages[row.name] = row.average)
callback(null, packages)
})
示例2: readExistingTweets
function readExistingTweets(outputFilepath: string,
callback: (error: Error, fetchedStatuses?: {[index: string]: number}) => void) {
let fetchedStatuses: {[index: string]: number} = {};
// quick exit if output is undefined
if (outputFilepath === undefined) return callback(null, fetchedStatuses);
logger.info(`Reading existing tweets from "${outputFilepath}"`);
let inputStream = createReadStream(outputFilepath, {flags: 'r', encoding: 'utf8'});
inputStream.pipe(new JSONParser())
.on('data', (status: Status) => {
fetchedStatuses[status.id_str] = 1;
})
.on('error', (error: Error) => {
callback(error);
})
.on('end', () => {
logger.info(`Found ${Object.keys(fetchedStatuses).length} tweets in "${outputFilepath}"`);
callback(null, fetchedStatuses);
});
}
示例3: callback
.on('end', () => {
logger.info(`Found ${Object.keys(fetchedStatuses).length} tweets in "${outputFilepath}"`);
callback(null, fetchedStatuses);
});
示例4:
server.on('listening', () => {
const address = server.address()
const addressString = typeof address == 'string' ? address : `${address.address}:${address.port}`
logger.info('server listening on http://%s', addressString)
})