function consoleHandler(record) {
  if (typeof console === 'undefined' || !console) {
    return;
  }
  record = /** @type {!LogRecord} */(record);
  var timestamp = new Date(record.getMillis());
  var msg =
      '[' + timestamp.getUTCFullYear() + '-' +
      padNumber(timestamp.getUTCMonth() + 1, 2) + '-' +
      padNumber(timestamp.getUTCDate(), 2) + 'T' +
      padNumber(timestamp.getUTCHours(), 2) + ':' +
      padNumber(timestamp.getUTCMinutes(), 2) + ':' +
      padNumber(timestamp.getUTCSeconds(), 2) + 'Z]' +
      '[' + record.getLevel().name + ']' +
      '[' + record.getLoggerName() + '] ' +
      record.getMessage();

  var level = record.getLevel().value;
  if (level >= Logger.Level.SEVERE.value) {
    console.error(msg);
  } else if (level >= Logger.Level.WARNING.value) {
    console.warn(msg);
  } else {
    console.log(msg);
  }
}
function consoleHandler(record) {
  if (typeof console === 'undefined' || !console) {
    return;
  }
  record = /** @type {!LogRecord} */(record);
  var timestamp = new Date(record.getMillis());
  var msg =
      '[' + timestamp.getUTCFullYear() + '-' +
      padNumber(timestamp.getUTCMonth() + 1, 2) + '-' +
      padNumber(timestamp.getUTCDate(), 2) + 'T' +
      padNumber(timestamp.getUTCHours(), 2) + ':' +
      padNumber(timestamp.getUTCMinutes(), 2) + ':' +
      padNumber(timestamp.getUTCSeconds(), 2) + 'Z]' +
      '[' + record.getLevel().name + ']' +
      '[' + record.getLoggerName() + '] ' +
      record.getMessage();

  var level = record.getLevel().value;
  if (level >= Logger.Level.SEVERE.value) {
    console.error(msg);
  } else if (level >= Logger.Level.WARNING.value) {
    console.warn(msg);
  } else {
    console.log(msg);
  }
}
function consoleHandler ( record ) { if ( typeof console === 'undefined' || ! console ) { return ; } record = /** @type {!LogRecord} */ ( record ) ; var timestamp = new Date ( record . getMillis ( ) ) ; var msg = '[' + timestamp . getUTCFullYear ( ) + '-' + padNumber ( timestamp . getUTCMonth ( ) + 1 , 2 ) + '-' + padNumber ( timestamp . getUTCDate ( ) , 2 ) + 'T' + padNumber ( timestamp . getUTCHours ( ) , 2 ) + ':' + padNumber ( timestamp . getUTCMinutes ( ) , 2 ) + ':' + padNumber ( timestamp . getUTCSeconds ( ) , 2 ) + 'Z]' + '[' + record . getLevel ( ) . name + ']' + '[' + record . getLoggerName ( ) + '] ' + record . getMessage ( ) ; var level = record . getLevel ( ) . value ; if ( level >= Logger . Level . SEVERE . value ) { console . error ( msg ) ; } else if ( level >= Logger . Level . WARNING . value ) { console . warn ( msg ) ; } else { console . log ( msg ) ; } }
Logs all messages to the Console API.
Logs all messages to the Console API .
consoleHandler - console handler