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


TypeScript brolog.Brolog类代码示例

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


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

示例1: doLog

 doLog(logger: Brolog | typeof Brolog, loggerName: string) {
   logger.error('LogApp', 'error messsage from %s', loggerName)
   logger.warn('LogApp', 'warn message from %s', loggerName)
   logger.info('LogApp', 'info message from %s', loggerName)
   logger.verbose('LogApp', 'verbose message from %s', loggerName)
   logger.silly('LogApp', 'silly message from %s', loggerName)
 }
开发者ID:zixia,项目名称:brolog-angular-demo,代码行数:7,代码来源:main.ts

示例2: constructor

 constructor(
   private authService: AuthService
   , private router: Router
   , private log: Brolog
 ) {
   log.verbose('AuthGuardService', 'constructor()')
 }
开发者ID:zixia,项目名称:wechaty-app,代码行数:7,代码来源:auth-guard.service.ts

示例3: beforeEach

 beforeEach(() => {
   TestBed.configureTestingModule({
     providers: [
       {
         provide: Brolog,
         useFactory() { return Brolog.instance('info') },
       },
       Injector,
     ],
   })
 })
开发者ID:zixia,项目名称:wechaty-angular-core,代码行数:11,代码来源:io.spec.ts

示例4: doLog

function doLog() {
  log.error('LogApp', 'error')
  log.warn('LogApp', 'warn')
  log.info('LogApp', 'info')
  log.verbose('LogApp', 'verbose')
  log.silly('LogApp', 'silly')
}
开发者ID:zixia,项目名称:brolog,代码行数:7,代码来源:smoke-testing.ts

示例5: updateTimer

  public updateTimer(delayTime?: number) {
    delayTime = delayTime || this.delayTime()
    log.verbose('Talker', 'updateTimer(%s)', delayTime)

    if (this.timer) { clearTimeout(this.timer) }
    this.timer = setTimeout(this.say.bind(this), delayTime, 3)
  }
开发者ID:miggame,项目名称:wechaty,代码行数:7,代码来源:api-ai-bot.ts

示例6: load

 public load() {
   const text = this.obj.text.join(', ')
   log.verbose('Talker', 'load(%s)', text)
   this.obj.text = []
   this.obj.time = []
   return text
 }
开发者ID:miggame,项目名称:wechaty,代码行数:7,代码来源:api-ai-bot.ts

示例7: canActivate

  canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
    this.log.verbose('AuthGuardService', 'canActivate(%s)', state.url)
    if (this.authService.loggedIn) {
      this.log.verbose('AuthGuardService', 'canActivate() YES')
      return true
    }

    this.log.verbose('AuthGuardService', 'canActivate() NO')

    // Store the attempted URL for redirecting
    this.authService.redirectUrl = state.url

    // Navigate to the login page
    this.router.navigate(['/login'])
    return false
  }
开发者ID:zixia,项目名称:wechaty-app,代码行数:16,代码来源:auth-guard.service.ts

示例8: talk

.on('message', async m => {
  if (m.self()) { return }

  // co(function* () {
  //   const msg = yield m.load()
  const room = m.room()

  if (room && /Wechaty/i.test(await room.topic())) {
    log.info('Bot', 'talk: %s'  , m)
    talk(m)
  } else {
    log.info('Bot', 'recv: %s'  , m)
  }
  // })
  // .catch(e => log.error('Bot', 'on message rejected: %s' , e))
})
开发者ID:miggame,项目名称:wechaty,代码行数:16,代码来源:api-ai-bot.ts

示例9: say

 public async say() {
   log.verbose('Talker', 'say()')
   const text  = this.load()
   await this.thinker(text)
   .then(reply => this.emit('say', reply))
   this.timer = undefined
 }
开发者ID:miggame,项目名称:wechaty,代码行数:7,代码来源:api-ai-bot.ts

示例10: constructor

 constructor(
   thinker: (text: string) => Promise<string>,
 ) {
   log.verbose('Talker()')
   super()
   this.thinker = thinker
   this.obj = {
     text: [],
     time: [],
   }
 }
开发者ID:miggame,项目名称:wechaty,代码行数:11,代码来源:api-ai-bot.ts


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