本文整理汇总了TypeScript中brolog.Brolog.info方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Brolog.info方法的具体用法?TypeScript Brolog.info怎么用?TypeScript Brolog.info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类brolog.Brolog
的用法示例。
在下文中一共展示了Brolog.info方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
}
示例2: 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))
})
示例3: doLog
function doLog() {
log.error('LogApp', 'error')
log.warn('LogApp', 'warn')
log.info('LogApp', 'info')
log.verbose('LogApp', 'verbose')
log.silly('LogApp', 'silly')
}
示例4: function
.on('response', function(response: any) {
console.log(response)
/*
{ id: 'a09381bb-8195-4139-b49c-a2d03ad5e014',
timestamp: '2016-05-27T17:22:46.597Z',
result:
{ source: 'domains',
resolvedQuery: 'hi',
action: 'smalltalk.greetings',
parameters: { simplified: 'hello' },w
metadata: {},
fulfillment: { speech: 'Hi there.' },
score: 0 },
status: { code: 200, errorType: 'success' } }
*/
const reply: string = response.result.fulfillment.speech
if (!reply) {
log.info('ApiAi', `Talker do not want to talk for "${text}"`)
return reject()
}
log.info('ApiAi', 'Talker reply:"%s" for "%s" ', reply, text)
return resolve(reply)
})
示例5:
.on('logout' , user => log.info('Bot', 'bot %s logout.', user))
示例6: Brolog
/**
* Wechaty - https://github.com/chatie/wechaty
*
* @copyright 2016-2018 Huan LI <zixia@zixia.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Brolog } from 'brolog'
const brolog = new Brolog()
brolog.info('OK', 'with-import.ts')