improve logging

This commit is contained in:
jomo 2015-04-22 00:26:10 +02:00
parent 7ca43e3cd9
commit 3cdcccde57
4 changed files with 3 additions and 6 deletions

View File

@ -98,7 +98,7 @@ exp.info = function(callback) {
// these 60 seconds match the duration of Mojang's rate limit ban // these 60 seconds match the duration of Mojang's rate limit ban
// callback: error // callback: error
exp.update_timestamp = function(rid, userId, hash, temp, callback) { exp.update_timestamp = function(rid, userId, hash, temp, callback) {
logging.log(rid, "cache: updating timestamp"); logging.debug(rid, "updating cache timestamp");
var sub = temp ? (config.local_cache_time - 60) : 0; var sub = temp ? (config.local_cache_time - 60) : 0;
var time = Date.now() - sub; var time = Date.now() - sub;
// store userId in lower case if not null // store userId in lower case if not null
@ -114,7 +114,7 @@ exp.update_timestamp = function(rid, userId, hash, temp, callback) {
// this feature can be used to write both cape and skin at separate times // this feature can be used to write both cape and skin at separate times
// +callback+ contans error // +callback+ contans error
exp.save_hash = function(rid, userId, skin_hash, cape_hash, callback) { exp.save_hash = function(rid, userId, skin_hash, cape_hash, callback) {
logging.log(rid, "cache: saving skin:" + skin_hash + " cape:" + cape_hash); logging.debug(rid, "caching skin:" + skin_hash + " cape:" + cape_hash);
var time = Date.now(); var time = Date.now();
// store shorter null byte instead of "null" // store shorter null byte instead of "null"
skin_hash = (skin_hash === null ? "" : skin_hash); skin_hash = (skin_hash === null ? "" : skin_hash);
@ -138,7 +138,7 @@ exp.save_hash = function(rid, userId, skin_hash, cape_hash, callback) {
// removes the hash for +userId+ from the cache // removes the hash for +userId+ from the cache
exp.remove_hash = function(rid, userId) { exp.remove_hash = function(rid, userId) {
logging.log(rid, "cache: deleting hash"); logging.log(rid, "deleting hash from cache");
redis.del(userId.toLowerCase(), "h", "t"); redis.del(userId.toLowerCase(), "h", "t");
}; };

View File

@ -52,7 +52,6 @@ module.exports = function(req, callback) {
// strip dashes // strip dashes
userId = userId.replace(/-/g, ""); userId = userId.replace(/-/g, "");
logging.debug(req.id, "userid:", userId);
try { try {
helpers.get_avatar(req.id, userId, helm, size, function(err, status, image, hash) { helpers.get_avatar(req.id, userId, helm, size, function(err, status, image, hash) {

View File

@ -72,7 +72,6 @@ module.exports = function(req, callback) {
// strip dashes // strip dashes
userId = userId.replace(/-/g, ""); userId = userId.replace(/-/g, "");
logging.debug(rid, "userId:", userId);
try { try {
helpers.get_render(rid, userId, scale, helm, body, function(err, status, hash, image) { helpers.get_render(rid, userId, scale, helm, body, function(err, status, hash, image) {

View File

@ -50,7 +50,6 @@ module.exports = function(req, callback) {
// strip dashes // strip dashes
userId = userId.replace(/-/g, ""); userId = userId.replace(/-/g, "");
logging.debug(rid, "userid:", userId);
try { try {
helpers.get_skin(rid, userId, function(err, hash, status, image) { helpers.get_skin(rid, userId, function(err, hash, status, image) {