How to use the corvid-local-logger.logger.addExtraData function in corvid-local-logger

To help you get started, we’ve selected a few corvid-local-logger 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 wix-incubator / corvid / packages / corvid-cli / src / apps / clone.js View on Github external
async function extractSiteData(url, cookie) {
  const normalizedGivenUrl = normalize(url, { forceHttps: true });
  const parsedUrl = new URL(normalizedGivenUrl);
  const siteList = await getUserSiteList(cookie);
  logger.addExtraData({ userSiteList: siteList });

  if (parsedUrl.hostname === editorDomain) {
    const metasiteId = extractDataFromEditorUrl(parsedUrl);
    const site = siteList.find(site => site.metasiteId === metasiteId);

    return {
      metasiteId,
      siteName: site ? site.siteName : null,
      siteBelongsToUser: !!site
    };
  } else if (
    parsedUrl.hostname.endsWith(publicWixDomain) &&
    parsedUrl.pathname.startsWith(editorPath)
  ) {
    const metasiteId = extractDataFromPublicUrl(parsedUrl);
    const site = siteList.find(site => site.metasiteId === metasiteId);