Authored by htoooth

debug format

... ... @@ -21,7 +21,7 @@ class MySqlSender {
const len = this.batchMessages.length;
if (len < 1) {
logger.debug('[db] insert list is empty');
// logger.debug('[db] insert list is empty');
return;
}
... ...
... ... @@ -58,7 +58,7 @@ module.exports = (req, res, next) => {
item.u = 0;
}
} catch (e) {
logger.debug('[client] decode uid error [%s]', item.u);
logger.error('[client] decode uid error [%s]', item.u);
item.u = 0;
}
} else {
... ...
... ... @@ -15,8 +15,8 @@ module.exports = async({user}, next) => {
let ipBlackRes = result[0];
let ipLimitRes = result[1];
logger.debug('ip==>', ipBlackKey, ipBlackRes);
logger.debug('ip==>', ipLimitKey, ipLimitRes);
logger.debug('ip==>%s value=%d', ipBlackKey, ipBlackRes || 0);
logger.debug('ip==>%s value=%d', ipLimitKey, ipLimitRes || 0);
if ((ipBlackRes && +ipBlackRes > 0) || (ipLimitRes && +ipLimitRes > 0)) {
return;
... ...
... ... @@ -28,6 +28,8 @@ module.exports = async({user}, next) => {
getOp.human = cache.getAsync(`${appType}:${limitKey}:ishuman:${user.ip}`);
return Promise.props(getOp).then((results) => {
logger.debug('[qps result] %j', getOp);
if (results.human) { // 经过验证码之后1小时有效期内不再验证qps
logger.info('[qps] this user[%j] is being marked as human', user);
return {};
... ...
... ... @@ -28,7 +28,7 @@ module.exports = async({user}, next) => {
let key = `${WHITE_LIST_KEY}${remoteIp}`;
let remoteIpSegment = `${remoteIp.split('.').slice(0, 2).join('.')}.`;
logger.debug('whitelist-ip==>%s', user.path);
logger.debug('whitelist-ip==>%s', user.ip);
if (_.includes(IP_WHITE_LIST, remoteIp) || _.includes(IP_WHITE_SEGMENT, remoteIpSegment)) {
return;
}
... ...