当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Logger.handleExceptions方法代码示例

本文整理汇总了TypeScript中winston.Logger.handleExceptions方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Logger.handleExceptions方法的具体用法?TypeScript Logger.handleExceptions怎么用?TypeScript Logger.handleExceptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在winston.Logger的用法示例。


在下文中一共展示了Logger.handleExceptions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: Copyright

along with TPC.js.  If not, see <http://www.gnu.org/licenses/>.
*/

/* TypeScript headers */
/// <reference path="../typings/node/node.d.ts" />


var GPLv3Message =
"TPC.js  Copyright (C) 2014  Gurjeet Singh, http://gurjeet.singh.im"
+ "\n" + "This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you"
+ "\n" + "are welcome to redistribute it under terms of GNU General Public License version 3.";

var blessed = require('blessed');
var winston = require('winston');
var g_logger = new (winston.Logger)({ exitOnError: false })
g_logger.handleExceptions(new winston.transports.File({ filename: '/tmp/tpcc_exceptions.log' }))    /* XXX This doesn't seem to do anything when an exception occurs! */
g_logger.add(winston.transports.File, { filename: uvp_log_file });

g_logger.log('info', 'Beginning TPC-C run.');

/* Create a screen */
/*
 * XXX: For some inexplicable reason, if this variable is named 'screen', it
 * causes `tsc` to emit an error, and no amount of diagnosis resolved the error.
 *
 * TODO: Create a definition file for blessed and contribute it to
 * DefinitelyTyped repo.
 */
var mainScreen: any = blessed.screen();

/*
开发者ID:llcoolchak,项目名称:DBYardstick,代码行数:31,代码来源:tpcc.ts


注:本文中的winston.Logger.handleExceptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。