function generateLogObjects() {
  let p;
  return redis.hgetallAsync(PUB_STATS_HASH)
  .then((res) => p = res)
  .then(() => redis.delAsync(PUB_STATS_HASH))
  .then(() => {
    if (p) {
      return Object.keys(p).map((key) => toLogObj(key, p[key]));
    }

    return [];
  });
} // generateLogObjects
/**
 * Generate the logging objects, one per publish "key". Look up the pubStats
 * hash in redis and "reset" it by deleting it; generate and return an array of
 * pubStats activity type logging objects.
 *
 * @returns {Array} array of pubStats activity type logging objects
 */
Generate the logging objects, one per publish "key". Look up the pubStats
hash in redis and "reset" it by deleting it; generate and return an array of
pubStats activity type logging objects.

@returns {Array} array of pubStats activity type logging objects
Generate the logging objects one per publish " key " . Look up the pubStats hash in redis and " reset " it by deleting it ; generate and return an array of pubStats activity type logging objects . @returns { Array } array of pubStats activity type logging objects
function generateLogObjects() {
  let p;
  return redis.hgetallAsync(PUB_STATS_HASH)
  .then((res) => p = res)
  .then(() => redis.delAsync(PUB_STATS_HASH))
  .then(() => {
    if (p) {
      return Object.keys(p).map((key) => toLogObj(key, p[key]));
    }
    return [];
  });
} 
function generateLogObjects ( ) { let p ; return redis . hgetallAsync ( PUB_STATS_HASH ) . then ( ( res ) => p = res ) . then ( ( ) => redis . delAsync ( PUB_STATS_HASH ) ) . then ( ( ) => { if ( p ) { return Object . keys ( p ) . map ( ( key ) => toLogObj ( key , p [ key ] ) ) ; } return [ ] ; } ) ; }
Generate the logging objects, one per publish "key".
Generate the logging objects one per publish " key " .
// generateLogObjects