How to use the loglevel.log function in loglevel

To help you get started, we’ve selected a few loglevel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github antonycourtney / tabli / archive / src / js / tabManagerState.js View on Github external
syncChromeWindow (chromeWindow) {
    const prevTabWindow = this.windowIdMap.get(chromeWindow.id)
    /*
    if (!prevTabWindow) {
      log.log("syncChromeWindow: detected new chromeWindow: ", chromeWindow)
    }
    */
    const tabWindow = prevTabWindow ? TabWindow.updateWindow(prevTabWindow, chromeWindow) : TabWindow.makeChromeTabWindow(chromeWindow)
    const stReg = this.registerTabWindow(tabWindow)

    // if window has focus and is a 'normal' window, update current window id:
    const updCurrent = chromeWindow.focused && validChromeWindow(chromeWindow, true)
    const st = updCurrent ? stReg.set('currentWindowId', chromeWindow.id) : stReg

    if (updCurrent) {
      log.log('syncChromeWindow: updated current window to: ', chromeWindow.id)
    }

    return st
  }
github sienori / Tab-Session-Manager / src / background / backup.js View on Github external
function returnFileName(sessions) {
  log.log(logDir, "returnFileName()", sessions);
  const sessionLabel = browser.i18n.getMessage("sessionLabel").toLowerCase();
  const sessionsLabel = browser.i18n.getMessage("sessionsLabel").toLowerCase();

  let fileName = `${moment().format(getSettings("dateFormat"))} (${sessions.length} ${
    sessions.length == 1 ? sessionLabel : sessionsLabel
  })`;

  const pattern = /\\|\/|\:|\?|\.|"|<|>|\|/g;
  fileName = fileName.replace(pattern, "-");
  return fileName;
}
github antonycourtney / tabli / archive / src / js / prefsPage.js View on Github external
const onUpdatePreferences = (storeRef, newPrefs) => {
  log.log('update preferences: ', newPrefs.toJS())
  actions.savePreferences(newPrefs, storeRef)
  onClose()
}
github sienori / Tab-Session-Manager / src / background / save.js View on Github external
export async function saveSession(session, isSendResponce = true) {
  log.log(logDir, "saveSession()", session, isSendResponce);
  try {
    await Sessions.put(session);
    if (isSendResponce) sendMessage("saveSession", { session: session });
    return session;
  } catch (e) {
    log.error(logDir, "saveSession()", e);
    return Promise.reject(e);
  }
}
github sienori / Tab-Session-Manager / src / popup / actions / controlSessions.js View on Github external
export const sendSessionUpdateMessage = async session => {
  log.log(logDir, "sendSessionUpdateMessage()", session);
  return await browser.runtime.sendMessage({
    message: "update",
    session: session,
    isSendResponce: true
  });
};
github sienori / Tab-Session-Manager / src / background / autoSave.js View on Github external
async function isChangedAutoSaveSession(session) {
  log.log(logDir, "isChangedAutoSaveSession()");
  const regularSessions = await getSessionsByTag("regular", ["id", "tag", "date", "windows"]);
  if (regularSessions.length == 0) return true;

  const tabsToString = session => {
    let retArray = [];
    for (let windowNo in session.windows) {
      retArray.push(windowNo);
      for (let tabNo in session.windows[windowNo]) {
        const tab = session.windows[windowNo][tabNo];
        retArray.push(tab.id, tab.url);
      }
    }
    return retArray.toString();
  };

  //前回保存時とタブが異なればtrue
github antonycourtney / tabli / archive / src / js / components / FlatButton.js View on Github external
handleClick = (event) => {
    log.log('FlatButton.handleClick: ', this.props)
    event.stopPropagation()
    event.preventDefault()
    if (this.props.onClick) {
      this.props.onClick(event)
    }
    log.log('FlatButton.handleClick: returning false')
    return false
  };
github antonycourtney / tabli / archive / src / js / prefsPage.js View on Github external
const onClose = async () => {
  log.log('onClose')
  const tab = await chromep.tabs.getCurrent()
  log.log('onClose tab: ', tab)
  chrome.tabs.remove(tab.id)
}
github antonycourtney / tabli / archive / src / js / tabManagerState.js View on Github external
handleTabClosed (tabWindow, tabId) {
    log.log('handleTabClosed: closing tab id ', tabId)
    var updWindow = TabWindow.closeTab(tabWindow, tabId)
    log.log('handleTabClosed: updWindow: ', updWindow.toJS())
    return this.registerTabWindow(updWindow)
  }