function consoleHandler(entry) {
  if (typeof console === 'undefined' || !console) {
    return;
  }

  var timestamp = new Date(entry.timestamp);
  var msg =
      '[' + timestamp.getUTCFullYear() + '-' +
      pad(timestamp.getUTCMonth() + 1) + '-' +
      pad(timestamp.getUTCDate()) + 'T' +
      pad(timestamp.getUTCHours()) + ':' +
      pad(timestamp.getUTCMinutes()) + ':' +
      pad(timestamp.getUTCSeconds()) + 'Z] ' +
      '[' + entry.level.name + '] ' +
      entry.message;

  var level = entry.level.value;
  if (level >= Level.SEVERE.value) {
    console.error(msg);
  } else if (level >= Level.WARNING.value) {
    console.warn(msg);
  } else {
    console.log(msg);
  }
}
function consoleHandler(entry) {
  if (typeof console === 'undefined' || !console) {
    return;
  }

  var timestamp = new Date(entry.timestamp);
  var msg =
      '[' + timestamp.getUTCFullYear() + '-' +
      pad(timestamp.getUTCMonth() + 1) + '-' +
      pad(timestamp.getUTCDate()) + 'T' +
      pad(timestamp.getUTCHours()) + ':' +
      pad(timestamp.getUTCMinutes()) + ':' +
      pad(timestamp.getUTCSeconds()) + 'Z] ' +
      '[' + entry.level.name + '] ' +
      entry.message;

  var level = entry.level.value;
  if (level >= Level.SEVERE.value) {
    console.error(msg);
  } else if (level >= Level.WARNING.value) {
    console.warn(msg);
  } else {
    console.log(msg);
  }
}
function consoleHandler ( entry ) { if ( typeof console === 'undefined' || ! console ) { return ; } var timestamp = new Date ( entry . timestamp ) ; var msg = '[' + timestamp . getUTCFullYear ( ) + '-' + pad ( timestamp . getUTCMonth ( ) + 1 ) + '-' + pad ( timestamp . getUTCDate ( ) ) + 'T' + pad ( timestamp . getUTCHours ( ) ) + ':' + pad ( timestamp . getUTCMinutes ( ) ) + ':' + pad ( timestamp . getUTCSeconds ( ) ) + 'Z] ' + '[' + entry . level . name + '] ' + entry . message ; var level = entry . level . value ; if ( level >= Level . SEVERE . value ) { console . error ( msg ) ; } else if ( level >= Level . WARNING . value ) { console . warn ( msg ) ; } else { console . log ( msg ) ; } }
Logs all messages to the Console API.
@param {!Entry} entry the entry to log.
Logs all messages to the Console API .
console handler for console. log