本文整理汇总了TypeScript中winston.info函数的典型用法代码示例。如果您正苦于以下问题:TypeScript info函数的具体用法?TypeScript info怎么用?TypeScript info使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了info函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: setup
export function setup(router: express.Router) {
logger.info('Setting up request mapping for for user');
router.get('/secure/user', (req: any, res: express.Response) => {
res.json(req.session.passport.user);
});
return router;
}
示例2: init
public async init(): Promise<FSWatcher> {
try {
logger.info('Starting watcher');
return this.fswatcher.on('add', this.onAdd.bind(this));
} catch (err) {
logger.error(err);
throw err;
}
}
示例3:
cursor.each(function(err, row) {
if (err) {
throw err;
}
winston.info('myCategoriesFeed => cursor.each');
const admins = _.merge(_.get(row, 'old_val.admins', []), _.get(row, 'new_val.admins', []));
for (let playerId of admins) {
emit('myCategories:' + playerId + ':feed', JSON.stringify(row));
}
});
示例4: onClose
/**
* Called whenever a client disconnnects
*/
private onClose() {
if ( this.onDisconnected )
this.onDisconnected( this );
winston.info( `Websocket disconnected: ${this.domain}`, { process: process.pid } )
this.ws.removeAllListeners( 'message' );
this.ws.removeAllListeners( 'close' );
this.ws.removeAllListeners( 'error' );
}
示例5: handleFile
private async handleFile(filePath: string): Promise<boolean> {
logger.info('Taking file: %s', filePath);
const jobType = this.getJobType(filePath);
logger.debug('Took %s %s', filePath, jobType);
// Give directories a chance to write cover files
// await sleep(1000);
return this.dispatcher.enqueueFile(filePath, jobType);
}
示例6: listen
public listen(...args: any[]) {
this.port = args[0];
this.server.listen.apply(this.server, args);
this.sbc.connect(this.port);
log.info("Stage listening on port " + this.port + " for resource " +
this.route);
// TODO: Add John's hack for getting the current IP here.
}
示例7: handleEcho
handleEcho(payload: FBTypes.MessengerPayload) {
logger.info("echo received:", payload);
// keep track of last time we sent anything to this user
return new Volunteer({ fbid: payload.recipient.id })
.save(
{ last_messaged: moment().format(DATE_FORMAT) },
{ patch: true, require: false }
);
}
示例8: function
this.mailgun.messages().send( { from: from, subject: subject, text: msg, to: to }, function( err, response ) {
if ( err ) {
winston.error( `Could not send email to ${to}: ${err}`, { process: process.pid } );
return reject( err );
}
winston.info( `Email sent ${JSON.stringify( response )} unmodified`, { process: process.pid } );
return resolve( true );
} );
示例9: onMessage
/**
* Called whenever we recieve a message from a client
*/
private onMessage( message: string ) {
winston.info( `Received message from client: '${message}'`, { process: process.pid } );
try {
const token: def.SocketTokens.IToken = JSON.parse( message );
this._controller.processServerInstruction( new ServerInstruction( token, this ) );
}
catch ( err ) {
winston.error( `Could not parse socket message: '${err}'`, { process: process.pid } );
}
}
示例10: function
}, function( err ) {
if ( !err ) {
winston.info( `Modified email sent ${JSON.stringify( response )}`, { process: process.pid } );
return resolve( true );
}
else {
winston.error( `Could not modify email ${JSON.stringify( response )}: ${err}`, { process: process.pid } );
return reject( err );
}
} );