本文整理匯總了TypeScript中winston.Logger.verbose方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Logger.verbose方法的具體用法?TypeScript Logger.verbose怎麽用?TypeScript Logger.verbose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類winston.Logger
的用法示例。
在下文中一共展示了Logger.verbose方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: stopped
const shutdown = (signal: string) => {
logger.verbose('Server is shutting down...');
db.close();
logger.verbose('Database connection closed...');
server.close((e: any) => {
if (e) {
logger.error(e);
process.exit(1);
}
logger.warn(`Server stopped (${signal}).`);
process.exit();
});
};
示例2: shutdown
process.on('SIGTERM', () => {
logger.verbose('Got SIGTERM. Server shutdown started.');
shutdown('SIGTERM');
});
示例3: Koa
import constants from './constants';
import config from './config';
import router from './routes';
import db from './db';
const logger = new winston.Logger({
transports: [
new winston.transports.Console({
json: false,
timestamp: true,
level: config.log.level
})
]
});
logger.verbose('Starting with configuration', config);
const app = new Koa();
app.use(compress());
app.use(cors);
app.use(logging(logger));
app.use(bodyParser());
app.use(router.routes());
const server = http.createServer(app.callback());
server.setTimeout(constants.socketLifetime);
db.connect(config.db.url, config.db.name, config.db.options)
.then(() => server.listen(config.app.port as number, config.app.ip))
.then(() => logger.verbose(`Listening on port ${config.app.port}`))
示例4:
.then(() => logger.verbose(`Listening on port ${config.app.port}`))
示例5: parse
verbose: (message: string, ...args: any[]) => logger.verbose(format(scope, message), parse(args)),