• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript util.debuglog函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中util.debuglog函数的典型用法代码示例。如果您正苦于以下问题:TypeScript debuglog函数的具体用法?TypeScript debuglog怎么用?TypeScript debuglog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: debuglog

  GoAwayFrame,
  ConnectionCloseFrame,
  WindowUpdateFrame,
  StopWaitingFrame,
  BlockedFrame,
} from './internal/frame'
import { Packet, ResetPacket, RegularPacket } from './internal/packet'
import { QuicError, StreamError } from './internal/error'
import { ConnectionFlowController } from './internal/flowcontrol'
import { RTTStats } from './internal/congestion'

import { Socket, sendPacket } from './socket'
import { Stream } from './stream'
import { BufferVisitor, toBuffer, Queue } from './internal/common'

const debug = debuglog('quic:session')

//
// *************** Session ***************
//
export class Session extends EventEmitter {
  // Event: 'timeout'
  // Event: 'close'
  // Event: 'error'
  // Event: 'stream'
  // Event: 'version'
  // Event: 'goaway'

  protected [kID]: ConnectionID
  protected [kType]: SessionType
  protected [kIntervalCheck]: NodeJS.Timer | null
开发者ID:toajs,项目名称:quic,代码行数:31,代码来源:session.ts


示例2: find

#!/usr/bin/env node

import bluebird from 'bluebird';
import fs from 'fs';
import jubatus from 'jubatus';
import _ from 'lodash';
import minimist from 'minimist';
import path from 'path';
import util from 'util';

const debug = util.debuglog('jubatus-tutorial-node');
const { common: { types: { Datum } }, classifier: { types: { LabeledDatum }, client: { Classifier } } } = jubatus;

const args = minimist(process.argv.slice(2), { default: { p: 9199, h: 'localhost', n: '', t: 0, c: 10 } });
debug('%o', args);

const { p: port, h: host, n: name, t: timeout, c: concurrency } = args;
const classifier = new Classifier(port, host, name, timeout);

const readFile = bluebird.promisify(fs.readFile);
const readDir = bluebird.promisify(fs.readdir);
const find = (dirname: string) => readDir(dirname).then(files => files.map(file => path.join(dirname, file)));
const mapStat = (file: string, iteratee: (stat: fs.Stats, file: string) => string | any) =>
    new Promise<string>((resolve, reject) => fs.stat(file, (error, stat) => error ? reject(error) : resolve(iteratee(stat, file))));
const filterStat = (files: string[], predicate: (stat: fs.Stats) => boolean) =>
    // tslint:disable-next-line:no-shadowed-variable
    Promise.all(files.map(file => mapStat(file, stat => predicate(stat) && file))).then(files => files.filter(file => file));
const list = (dirname: string) => {
    return find(dirname)
        .then(files => filterStat(files, stat => stat.isDirectory()))
        .then(directories => Promise.all(directories.map(directory => find(directory))))
开发者ID:naokikimura,项目名称:jubatus-tutorial-node,代码行数:31,代码来源:tutorial.ts


示例3: require

const chalk = require('chalk');
const util = require('util');
const debuglog = util.debuglog('ghost');
const {GHOST_DEBUG} = process.env;

// { emerg: 0, alert: 1, crit: 2, error: 3, warning: 4, notice: 5, info: 6, debug: 7 }

// black
// red
// green
// yellow
// blue
// magenta
// cyan
// white
// gray

interface Logger {
	info(message, ...vars)
	debug(message, ...vars)
	error(message, ...vars)
}

function isoDate() {
	return (new Date(Date.now())).toISOString();
}

function noop() {
}

export function hex(buffer) {
开发者ID:w3gh,项目名称:ghost.js,代码行数:31,代码来源:Logger.ts


示例4: debuglog

  kVersion,
  kServer,
  kIntervalCheck,
} from './internal/symbol'
import {
  FamilyType,
  SocketAddress,
  SessionType,
  ConnectionID,
  isSupportedVersion,
} from './internal/protocol'

import { createSocket, Socket, AddressInfo } from './socket'
import { Session } from './session'

const debug = debuglog('quic')

export class ServerSession extends Session {
  [kServer]: Server
  constructor (id: ConnectionID, socket: Socket, server: Server) {
    super(id, SessionType.SERVER)
    this[kSocket] = socket
    this[kServer] = server
    this[kState].localPort = server.localPort
    this[kState].localAddress = server.localAddress
    this[kState].localFamily = server.localFamily
    this[kState].localAddr = new SocketAddress(server.address())
    this[kState].maxPacketSize =
      server.localFamily === FamilyType.IPv6 ? MaxPacketSizeIPv6 : MaxPacketSizeIPv4
  }
开发者ID:toajs,项目名称:quic,代码行数:30,代码来源:server.ts


示例5: debuglog

  StreamID,
} from './internal/protocol'
import { StreamFrame, RstStreamFrame, BlockedFrame } from './internal/frame'
import { StreamFlowController } from './internal/flowcontrol'
import { BufferVisitor } from './internal/common'
import {
  kID,
  kFC,
  kSession,
  kState,
  kRTT,
} from './internal/symbol'

import { Session } from './session'

const debug = debuglog('quic:stream')

export class Stream extends Duplex {
  // Event: 'close'
  // Event: 'connect'
  // Event: 'data'
  // Event: 'drain'
  // Event: 'end'
  // Event: 'error'
  // Event: 'timeout'
  // Event: 'aborted'
  // Event: 'finish'
  // Event: 'frameError'

  private [kID]: StreamID
  private [kSession]: Session
开发者ID:toajs,项目名称:quic,代码行数:31,代码来源:stream.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript util.deprecate函数代码示例发布时间:2022-05-25
下一篇:
TypeScript util.callbackify函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap