提交 233db8ab 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

log clean

上级 79451855
...@@ -10,7 +10,10 @@ ...@@ -10,7 +10,10 @@
* *
*/ */
import { Config } from './config' import {
Config
, log
} from './config'
import { Contact } from './contact' import { Contact } from './contact'
export abstract class FriendRequest { export abstract class FriendRequest {
...@@ -20,6 +23,8 @@ export abstract class FriendRequest { ...@@ -20,6 +23,8 @@ export abstract class FriendRequest {
public type: 'send' | 'receive' | 'confirm' public type: 'send' | 'receive' | 'confirm'
constructor() { constructor() {
log.verbose('FriendRequest', 'constructor()')
if (!Config.puppetInstance()) { if (!Config.puppetInstance()) {
throw new Error('no Config.puppetInstance() instanciated') throw new Error('no Config.puppetInstance() instanciated')
} }
......
...@@ -62,7 +62,7 @@ export class Browser extends EventEmitter { ...@@ -62,7 +62,7 @@ export class Browser extends EventEmitter {
try { try {
await this.driver.init() await this.driver.init()
log.verbose('PuppetWebBrowser', 'init() driver.init() succ') log.verbose('PuppetWebBrowser', 'init() driver.init() done')
await this.open(jumpUrl) await this.open(jumpUrl)
await this.loadCookie() await this.loadCookie()
...@@ -149,9 +149,9 @@ export class Browser extends EventEmitter { ...@@ -149,9 +149,9 @@ export class Browser extends EventEmitter {
try { try {
await this.driver.close().catch(e => { /* fail safe */ }) // http://stackoverflow.com/a/32341885/1123955 await this.driver.close().catch(e => { /* fail safe */ }) // http://stackoverflow.com/a/32341885/1123955
log.silly('PuppetWebBrowser', 'quit() driver.close() succ') log.silly('PuppetWebBrowser', 'quit() driver.close() done')
await this.driver.quit() await this.driver.quit()
log.silly('PuppetWebBrowser', 'quit() driver.quit() succ') log.silly('PuppetWebBrowser', 'quit() driver.quit() done')
/** /**
* *
......
...@@ -80,7 +80,7 @@ async function onBrowserDead(this: PuppetWeb, e): Promise<void> { ...@@ -80,7 +80,7 @@ async function onBrowserDead(this: PuppetWeb, e): Promise<void> {
try { try {
await this.browser.quit() await this.browser.quit()
log.verbose('PuppetWebEvent', 'onBrowserDead() browser.quit() succ') log.verbose('PuppetWebEvent', 'onBrowserDead() browser.quit() done')
if (browser.state.target() !== 'open') { if (browser.state.target() !== 'open') {
log.warn('PuppetWebEvent', 'onBrowserDead() will not init browser because browser.state.target(%s) !== open' log.warn('PuppetWebEvent', 'onBrowserDead() will not init browser because browser.state.target(%s) !== open'
......
...@@ -646,7 +646,7 @@ ...@@ -646,7 +646,7 @@
}) })
.then(function() { // succ .then(function() { // succ
// alert('ok') // alert('ok')
log('friendAdd(' + UserName + ', ' + VerifyContent + ') succ') log('friendAdd(' + UserName + ', ' + VerifyContent + ') done')
}, function(t) { // fail }, function(t) { // fail
// alert('not ok') // alert('not ok')
log('friendAdd(' + UserName + ', ' + VerifyContent + ') fail: ' + t) log('friendAdd(' + UserName + ', ' + VerifyContent + ') fail: ' + t)
...@@ -664,7 +664,7 @@ ...@@ -664,7 +664,7 @@
, Ticket , Ticket
}).then(function() { // succ }).then(function() { // succ
// alert('ok') // alert('ok')
log('friendVerify(' + UserName + ', ' + Ticket + ') succ') log('friendVerify(' + UserName + ', ' + Ticket + ') done')
}, function() { // fail }, function() { // fail
// alert('err') // alert('err')
log('friendVerify(' + UserName + ', ' + Ticket + ') fail') log('friendVerify(' + UserName + ', ' + Ticket + ') fail')
...@@ -760,7 +760,7 @@ ...@@ -760,7 +760,7 @@
this.WechatyBro = WechatyBro this.WechatyBro = WechatyBro
retObj.code = 200 retObj.code = 200
retObj.message = 'WechatyBro Inject Succ' retObj.message = 'WechatyBro Inject Done'
/** /**
* Two return mode of WebDriver (should be one of them at a time) * Two return mode of WebDriver (should be one of them at a time)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册