change log format
This commit is contained in:
@@ -36,12 +36,14 @@ class Config {
|
|||||||
finalize() {
|
finalize() {
|
||||||
if (this.options.env == 'development') {
|
if (this.options.env == 'development') {
|
||||||
this.options.level = this.options.level ? this.options.level : "DEBUG"
|
this.options.level = this.options.level ? this.options.level : "DEBUG"
|
||||||
logger.format = logger.formatters.dev;
|
logger.formatters.dev.omit = ['pid', 'port', 'hostname', 'app'];
|
||||||
|
// logger.format = logger.formatters.dev;
|
||||||
} else {
|
} else {
|
||||||
this.options.level = this.options.level ? this.options.level : "WARN"
|
this.options.level = this.options.level ? this.options.level : "WARN"
|
||||||
}
|
}
|
||||||
|
logger.formatters.json.omit = ['pid', 'port', 'hostname', 'app'];
|
||||||
logger.setLevel(this.options.level)
|
logger.setLevel(this.options.level)
|
||||||
logger.info('Environment setting options', this.options)
|
logger.debug(this.options, 'Environment setting options')
|
||||||
}
|
}
|
||||||
|
|
||||||
validate() {
|
validate() {
|
||||||
|
|||||||
@@ -120,10 +120,10 @@ class PuppeteerBrowser {
|
|||||||
return await this.getHtml(page, url)
|
return await this.getHtml(page, url)
|
||||||
});
|
});
|
||||||
|
|
||||||
logger.info('Cluster initialized %j', { cluster: this.getClsuterInfo() })
|
logger.debug({ cluster: this.getClsuterInfo() }, 'Cluster initialized')
|
||||||
}
|
}
|
||||||
this.cluster.queue(url);
|
this.cluster.queue(url);
|
||||||
logger.info('Add queue url(%s) cluster updated : %j', url, { cluster: this.getClsuterInfo() })
|
logger.debug({ url: url, cluster: this.getClsuterInfo() }, 'Add url to queue cluster updated')
|
||||||
return this.cluster.execute(url);
|
return this.cluster.execute(url);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class SeleniumBrowser {
|
|||||||
let requestUrl = new url.URL('https://2captcha.com/in.php')
|
let requestUrl = new url.URL('https://2captcha.com/in.php')
|
||||||
requestUrl.search = new url.URLSearchParams(captcha2Params).toString();
|
requestUrl.search = new url.URLSearchParams(captcha2Params).toString();
|
||||||
fetch(requestUrl).then(res => res.json()).then(res => {
|
fetch(requestUrl).then(res => res.json()).then(res => {
|
||||||
logger.info('2captcha IN-request response : %j', res)
|
logger.debug(res, '2captcha IN-request response')
|
||||||
if (!res.hasOwnProperty('request')) {
|
if (!res.hasOwnProperty('request')) {
|
||||||
throw new Error('2captcha IN-request response has no data request id : ' + JSON.stringify(res))
|
throw new Error('2captcha IN-request response has no data request id : ' + JSON.stringify(res))
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ class SeleniumBrowser {
|
|||||||
} while (res.request == 'CAPCHA_NOT_READY')
|
} while (res.request == 'CAPCHA_NOT_READY')
|
||||||
return res
|
return res
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
logger.info('2captcha solved : %j', res)
|
logger.debug(res, '2captcha solved')
|
||||||
// this.driver.findElement(By.css('#g-recaptcha-response')).setAttribute('innerHTML', res.request)
|
// this.driver.findElement(By.css('#g-recaptcha-response')).setAttribute('innerHTML', res.request)
|
||||||
this.driver.executeScript('captchaCallback("' + res.request + '")')
|
this.driver.executeScript('captchaCallback("' + res.request + '")')
|
||||||
this.driver.wait(10000).then(d => {
|
this.driver.wait(10000).then(d => {
|
||||||
|
|||||||
Reference in New Issue
Block a user