本文整理汇总了TypeScript中winston.Logger.info方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Logger.info方法的具体用法?TypeScript Logger.info怎么用?TypeScript Logger.info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类winston.Logger
的用法示例。
在下文中一共展示了Logger.info方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
process.on('exit', () => {
logger.info('Hello stopping');
if(server !== undefined) {
server.close();
}
});
示例2: info
export function info(args:Array) {
var text = '';
for (var i = 0; i < args.length; i++) {
var obj = args[i];
text += colors.magenta(obj);
}
logger2.info(text);
}
示例3: log
export function log(msg: any) {
const infoLog = new (winston.Logger)({
transports: [
new (winston.transports.Console)({
colorize: true,
level: 'info'
})
]
});
infoLog.info(msg);
};
示例4: info
export function info(str, meta?) {
if (meta) return logger.info(str, meta);
return logger.info(str);
}
示例5: function
level: 'info',
filename: 'server.txt',
json: false,
maxsize: 5242880, // 5MB
maxFiles: 2,
colorize: false
}).on('error', function(err) {
console.error(err.stack);
}),
new win.transports.Console({
level: 'debug',
json: false,
colorize: true
})
],
exitOnError: false
});
export const log = {
info(owner, ...params) {
logger.info(ensureStringLength(owner) + ' : ', ...params);
},
warn(owner, ...params) {
logger.warn(ensureStringLength(owner) + ' : ', ...params);
},
error(owner, ...params) {
logger.error(ensureStringLength(owner) + ' : ', ...params);
}
};
示例6: write
public write(message: string) {
logger.info(message);
}
示例7: info
public info(message:string){
winston_logger.info(message);
}
示例8: function
return function(req, res, next) {
req.profileInfo = util.format('HTTP %s %s', req.method, req.originalUrl);
winston_logger.info(req.profileInfo);
next();
};
示例9: new
import * as hello from './hello';
/* Set up Winston for logging ************************************************/
let logger = new (winston.Logger)({
transports: [
new (winston.transports.Console)({
timestamp: () => {
return (new Date).toISOString();
},
handleExceptions: true
})
]
});
logger.info('Hello starting');
/* Set up doing something useful *********************************************/
let app = express();
app.get("/", (request, response) => {
response.send(hello.greeting());
});
let server = app.listen(8080);
/* Set up exit handler *******************************************************/
process.on('exit', () => {
logger.info('Hello stopping');
示例10: parse
info: (message: string, ...args: any[]) => logger.info(format(scope, message), parse(args)),