{"size": 1024, "ext": "js", "max_stars_repo_path": "src/common/consoleWin.js", "max_stars_repo_name": "icoice/vue-moo", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/common/consoleWin.js", "max_issues_repo_name": "icoice/vue-moo", "max_issues_repo_issues_event_min_datetime": "2020-03-20T03:22:25.000Z", "max_issues_repo_issues_event_max_datetime": "2021-06-18T04:07:26.000Z", "max_forks_repo_path": "src/common/consoleWin.js", "max_forks_repo_name": "icoice/vue-moo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 14, "max_forks_count": null, "avg_line_length": 23.8139534884, "max_line_length": 81, "alphanum_fraction": 0.654296875}
/* 用于移动端远程调试看不到日志的问题 */
let log = null;
let logStatus = 'block';

function consoleContent(message) {
  return `
  <div style='margin: 1rem .5rem 0 .5rem; background-color: #666; padding: 10px'>
    ${message}
  </div>`;
}

function consoleWin(message) {
  if (log) {
    log.style.display = 'block';
    log.innerHTML = log.innerHTML + consoleContent(message);

    return log;
  }

  log = document.createElement('div');
  log.innerHTML = consoleContent(message);
  log.style.position = 'fixed';
  log.style.zIndex = '999999999';
  log.style.top = 0;
  log.style.left = 0;
  log.style.width = '100%';
  log.style.height = '250px';
  log.style.backgroundColor = '#000';
  log.style.color = '#fff';
  log.style.display = logStatus;
  log.style.fontSize = '12px';
  log.style.overflowY = 'scroll';
  log.onclick = () => {
    log.style.display = logStatus === 'block' ? 'none' : 'block';
    logStatus = log.style.display;
  };

  document.body.appendChild(log);
}

window.console_win = consoleWin;

export default consoleWin;