Back to index

lightning-sunbird  0.9+nobinonly
Functions
logging.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int AppendToGlobalMessageStream (char *szInfo)
void LogISTime (int iType)
void LogISProductInfo (void)
void LogISDestinationPath (void)
void LogISSetupType (void)
void LogISComponentsSelected (void)
void LogISComponentsToDownload (void)
void LogISComponentsFailedCRC (char *szList, int iWhen)
void LogISDownloadStatus (char *szStatus, char *szFailedFile)
void LogISDownloadProtocol (DWORD dwProtocolType)
void LogISXPInstall (int iWhen)
void LogISXPInstallComponent (char *szComponentName)
void LogISXPInstallComponentResult (DWORD dwErrorNumber)
void LogISLaunchApps (int iWhen)
void LogISLaunchAppsComponent (char *szComponentName)
void LogISLaunchAppsComponentUncompress (char *szComponentName, DWORD dwErr)
void LogISProcessXpcomFile (int iStatus, int iResult)
void LogISShared (void)
void LogISDiskSpace (dsN *dsnComponentDSRequirement)
void LogISTurboMode (BOOL bTurboMode)
void LogMSProductInfo (void)
void LogMSDownloadFileStatus (void)
void LogMSDownloadStatus (int iDownloadStatus)
void LogMSDownloadProtocol (DWORD dwProtocolType)
void LogMSXPInstallStatus (char *szFile, int iErr)
void LogMSTurboMode (BOOL bTurboMode)
void DeleteExitStatusFile (void)
void LogExitStatus (LPSTR status)
void GetGreSetupExitStatus (LPSTR aStatus, DWORD aStatusBufSize)

Function Documentation

int AppendToGlobalMessageStream ( char *  szInfo)

Definition at line 48 of file logging.c.

{
  DWORD dwInfoLen = lstrlen(szInfo);
  DWORD dwMessageLen;

  if(gErrorMessageStream.bEnabled && gErrorMessageStream.szMessage)
  {
    dwMessageLen = lstrlen(gErrorMessageStream.szMessage);
    if((dwInfoLen + dwMessageLen) >= gErrorMessageStream.dwMessageBufSize)
    {
      if(NS_GlobalReAlloc(&gErrorMessageStream.szMessage,
                          gErrorMessageStream.dwMessageBufSize,
                          dwInfoLen + dwMessageLen + MAX_BUF_TINY) == NULL)
        return(WIZ_OUT_OF_MEMORY);

      gErrorMessageStream.dwMessageBufSize = dwInfoLen +
                                             dwMessageLen +
                                             MAX_BUF_TINY;
    }

    lstrcat(gErrorMessageStream.szMessage, szInfo);
  }

  return(WIZ_OK);
}

Here is the call graph for this function:

Definition at line 621 of file logging.c.

{
  char logFile[MAX_BUF];

  GetExitStatusLogFile(sgProduct.szProductNameInternal, logFile, sizeof(logFile));
  if(FileExists(logFile))
    DeleteFile(logFile);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GetGreSetupExitStatus ( LPSTR  aStatus,
DWORD  aStatusBufSize 
)

Definition at line 650 of file logging.c.

{
  char logFile[MAX_BUF];

  *aStatus = '\0';
  GetExitStatusLogFile("GRE", logFile, sizeof(logFile));
  if(FileExists(logFile))
    GetPrivateProfileString(SECTION_EXIT_STATUS, KEY_STATUS, "", aStatus, aStatusBufSize, logFile);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogExitStatus ( LPSTR  status)

Definition at line 636 of file logging.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void LogISComponentsFailedCRC ( char *  szList,
int  iWhen 
)

Definition at line 327 of file logging.c.

{
  char szBuf[MAX_BUF];

  if(iWhen == W_STARTUP)
  {
    if(szList && (*szList != '\0'))
      wsprintf(szBuf,
               "\n    Components corrupted (startup):\n%s",
               szList);
    else
      wsprintf(szBuf,
               "\n    Components corrupted (startup):\n        none\n");
  }
  else
  {
    if(szList && (*szList != '\0'))
      wsprintf(szBuf,
               "\n    Components corrupted (download):\n%s",
               szList);
    else
      wsprintf(szBuf,
               "\n    Components corrupted (download):\n        none\n");
  }

  UpdateInstallStatusLog(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 173 of file logging.c.

{
  char szBuf[MAX_BUF_TINY];
  siC  *siCNode;
  BOOL bFoundComponentSelected;

  wsprintf(szBuf, "\n    Components selected:\n");
  UpdateInstallStatusLog(szBuf);

  bFoundComponentSelected = FALSE;
  siCNode = siComponents;
  do
  {
    if(siCNode == NULL)
      break;

    if(siCNode->dwAttributes & SIC_SELECTED)
    {
      if(!siCNode->bForceUpgrade)
        wsprintf(szBuf,
                 "        %s\n",
                 siCNode->szDescriptionShort);
      else
        wsprintf(szBuf,
                 "        %s (Required)\n",
                 siCNode->szDescriptionShort);

      UpdateInstallStatusLog(szBuf);
      bFoundComponentSelected = TRUE;
    }

    siCNode = siCNode->Next;
  } while((siCNode != NULL) && (siCNode != siComponents));

  if(!bFoundComponentSelected)
  {
    wsprintf(szBuf, "        none\n");
    UpdateInstallStatusLog(szBuf);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 214 of file logging.c.

{
  char szBuf[MAX_BUF_TINY];
  char szArchivePath[MAX_BUF_MEDIUM];
  siC  *siCNode;
  BOOL bFoundComponentSelected;
  BOOL bFoundComponentsToDownload;

  wsprintf(szBuf, "\n    Components to download:\n");
  UpdateInstallStatusLog(szBuf);

  bFoundComponentSelected = FALSE;
  bFoundComponentsToDownload = FALSE;
  siCNode = siComponents;
  do
  {
    if(siCNode == NULL)
      break;

    if(siCNode->dwAttributes & SIC_SELECTED)
    {

      if(LocateJar(siCNode,
                   szArchivePath,
                   sizeof(szArchivePath),
                   gbPreviousUnfinishedDownload) == AP_NOT_FOUND)
      {
        wsprintf(szBuf,
                 "        %s will be downloaded\n",
                 siCNode->szDescriptionShort);
        bFoundComponentsToDownload = TRUE;
      }
      else
        wsprintf(szBuf,
                 "        %s found: %s\n",
                 siCNode->szDescriptionShort,
                 szArchivePath);

      UpdateInstallStatusLog(szBuf);
      bFoundComponentSelected = TRUE;
    }

    siCNode = siCNode->Next;
  } while((siCNode != NULL) && (siCNode != siComponents));

  if(!bFoundComponentSelected)
  {
    wsprintf(szBuf, "        none\n");
    UpdateInstallStatusLog(szBuf);
  }
  if(!bFoundComponentsToDownload)
  {
    wsprintf(szBuf, "        **\n        ** All components have been found locally.  No components will be downloaded.\n        **\n");
    UpdateInstallStatusLog(szBuf);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 133 of file logging.c.

{
  char szBuf[MAX_BUF];

  wsprintf(szBuf,
           "\n    Destination Path:\n        Main: %s\n        SubPath: %s\n",
           sgProduct.szPath,
           sgProduct.szSubPath);
  UpdateInstallStatusLog(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogISDiskSpace ( dsN *  dsnComponentDSRequirement)

Definition at line 425 of file logging.c.

{
  ULONGLONG ullDSAvailable;
  dsN       *dsnTemp = NULL;
  char      szBuf[MAX_BUF];
  char      szDSRequired[MAX_BUF_TINY];
  char      szDSAvailable[MAX_BUF_TINY];

  if(dsnComponentDSRequirement != NULL)
  {
    wsprintf(szBuf, "\n    Disk Space Info:\n");
    UpdateInstallStatusLog(szBuf);
    dsnTemp = dsnComponentDSRequirement;
    do
    {
      if(!dsnTemp)
        break;

      ullDSAvailable = GetDiskSpaceAvailable(dsnTemp->szVDSPath);
      _ui64toa(ullDSAvailable, szDSAvailable, 10);
      _ui64toa(dsnTemp->ullSpaceRequired, szDSRequired, 10);
      wsprintf(szBuf,
               "             Path: %s\n         Required: %sKB\n        Available: %sKB\n",
               dsnTemp->szVDSPath,
               szDSRequired,
               szDSAvailable);
      UpdateInstallStatusLog(szBuf);

      dsnTemp = dsnTemp->Next;
    } while((dsnTemp != NULL) && (dsnTemp != dsnComponentDSRequirement));
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogISDownloadProtocol ( DWORD  dwProtocolType)

Definition at line 271 of file logging.c.

{
  char szBuf[MAX_BUF];
  char szProtocolType[MAX_BUF];

  switch(dwProtocolType)
  {
    case UP_HTTP:
      lstrcpy(szProtocolType, "HTTP");
      break;

    default:
      lstrcpy(szProtocolType, "FTP");
      break;
  }

  wsprintf(szBuf, "\n    Download protocol: %s\n", szProtocolType);
  UpdateInstallStatusLog(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogISDownloadStatus ( char *  szStatus,
char *  szFailedFile 
)

Definition at line 291 of file logging.c.

{
  char szBuf[MAX_BUF];
  siC   *siCObject = NULL;
  DWORD dwIndex;

  if(szFailedFile)
    wsprintf(szBuf,
             "\n    Download status: %s\n          file: %s\n\n",
             szStatus,
             szFailedFile);
  else
    wsprintf(szBuf,
             "\n    Download status: %s\n",
             szStatus);
  UpdateInstallStatusLog(szBuf);

  dwIndex = 0;
  siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
  while(siCObject)
  {
    if(siCObject->dwAttributes & SIC_SELECTED)
    {
      wsprintf(szBuf, "        %s: NetRetries:%d, CRCRetries:%d, NetTimeOuts:%d\n",
               siCObject->szDescriptionShort,
               siCObject->iNetRetries,
               siCObject->iCRCRetries,
               siCObject->iNetTimeOuts);
      UpdateInstallStatusLog(szBuf);
    }

    ++dwIndex;
    siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogISLaunchApps ( int  iWhen)

Definition at line 385 of file logging.c.

{
  char szBuf[MAX_BUF];

  if(iWhen == W_START)
    wsprintf(szBuf, "\n    Launch Apps Start\n");
  else
    wsprintf(szBuf, "    Launch Apps End\n");

  UpdateInstallStatusLog(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogISLaunchAppsComponent ( char *  szComponentName)

Definition at line 397 of file logging.c.

{
  char szBuf[MAX_BUF];

  wsprintf(szBuf, "    launching %s\n", szComponentName);
  UpdateInstallStatusLog(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogISLaunchAppsComponentUncompress ( char *  szComponentName,
DWORD  dwErr 
)

Definition at line 405 of file logging.c.

{
  char szBuf[MAX_BUF];

  wsprintf(szBuf, "    uncompressing %s: %d\n", szComponentName, dwErr);
  UpdateInstallStatusLog(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogISProcessXpcomFile ( int  iStatus,
int  iResult 
)

Definition at line 413 of file logging.c.

{
  char szBuf[MAX_BUF];

  if(iStatus == LIS_SUCCESS)
    wsprintf(szBuf, "\n    Uncompressing Xpcom Succeeded: %d\n", iResult);
  else
    wsprintf(szBuf, "\n    Uncompressing Xpcom Failed: %d\n", iResult);

  UpdateInstallStatusLog(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 103 of file logging.c.

{
  char szBuf[MAX_BUF];

  wsprintf(szBuf, "\n    Product Info:\n");
  UpdateInstallStatusLog(szBuf);

  switch(sgProduct.mode)
  {
    case SILENT:
      wsprintf(szBuf, "        Install mode: Silent\n");
      break;
    case AUTO:
      wsprintf(szBuf, "        Install mode: Auto\n");
      break;
    default:
      wsprintf(szBuf, "        Install mode: Normal\n");
      break;
  }
  UpdateInstallStatusLog(szBuf);

  wsprintf(szBuf, "        Company name: %s\n        Product name (external): %s\n        Product name (internal): %s\n        UserAgent: %s\n        Alternate search path: %s\n",
           sgProduct.szCompanyName,
           sgProduct.szProductName,
           sgProduct.szProductNameInternal,
           sgProduct.szUserAgent,
           sgProduct.szAlternateArchiveSearchPath);
  UpdateInstallStatusLog(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 153 of file logging.c.

{
  char szBuf[MAX_BUF_TINY];

  switch(dwSetupType)
  {
    case ST_RADIO1:
      wsprintf(szBuf, "\n    Setup Type: %s\n",
               diSetupType.stSetupType1.szDescriptionShort);
      break;

    default:
      wsprintf(szBuf, "\n    Setup Type: %s\n",
               diSetupType.stSetupType0.szDescriptionShort);
      break;
  }

  UpdateInstallStatusLog(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 144 of file logging.c.

{
  char szBuf[MAX_BUF];

  if(sgProduct.bSharedInst == TRUE)
    wsprintf(szBuf,"\n    Shared Installation:  TRUE\n");
  UpdateInstallStatusLog(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogISTime ( int  iType)

Definition at line 74 of file logging.c.

{
  char       szBuf[MAX_BUF];
  char       szTime[MAX_BUF_TINY];
  char       szDate[MAX_BUF_TINY];
  SYSTEMTIME stLocalTime;

  GetLocalTime(&stLocalTime);
  GetTimeFormat(LOCALE_NEUTRAL,
                LOCALE_NOUSEROVERRIDE,
                &stLocalTime,
                NULL,
                szTime,
                sizeof(szTime));
  GetDateFormat(LOCALE_NEUTRAL,
                LOCALE_NOUSEROVERRIDE,
                &stLocalTime,
                NULL,
                szDate,
                sizeof(szDate));

  if(iType == W_START)
    wsprintf(szBuf, "Start Log: %s - %s\n", szDate, szTime);
  else
    wsprintf(szBuf, "End Log: %s - %s\n", szDate, szTime);

  UpdateInstallStatusLog(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogISTurboMode ( BOOL  bTurboMode)

Definition at line 458 of file logging.c.

{
  char szBuf[MAX_BUF];

  if(bTurboMode)
    wsprintf(szBuf, "\n    Turbo Mode: true\n");
  else
    wsprintf(szBuf, "\n    Turbo Mode: false\n");

  UpdateInstallStatusLog(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogISXPInstall ( int  iWhen)

Definition at line 355 of file logging.c.

{
  char szBuf[MAX_BUF];

  if(iWhen == W_START)
    wsprintf(szBuf, "\n    XPInstall Start\n");
  else
    wsprintf(szBuf, "    XPInstall End\n");

  UpdateInstallStatusLog(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogISXPInstallComponent ( char *  szComponentName)

Definition at line 367 of file logging.c.

{
  char szBuf[MAX_BUF];

  wsprintf(szBuf, "        %s", szComponentName);
  UpdateInstallStatusLog(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 375 of file logging.c.

{
  char szBuf[MAX_BUF];
  char szErrorString[MAX_BUF];

  GetErrorString(dwErrorNumber, szErrorString, sizeof(szErrorString));
  wsprintf(szBuf, ": %d %s\n", dwErrorNumber, szErrorString);
  UpdateInstallStatusLog(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 526 of file logging.c.

{
  siC   *siCObject = NULL;
  DWORD dwIndex;
  char  szMessageStream[MAX_BUF];

  ZeroMemory(szMessageStream, sizeof(szMessageStream));
  dwIndex = 0;
  siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
  while(siCObject)
  {
    if(siCObject->iNetRetries ||
       siCObject->iCRCRetries ||
       siCObject->iNetTimeOuts)
    {
      char szFileInfo[MAX_BUF_SMALL];

      wsprintf(szFileInfo,
               "&%s=%d,%d,%d",
               siCObject->szArchiveName,
               siCObject->iNetRetries,
               siCObject->iCRCRetries,
               siCObject->iNetTimeOuts);

      lstrcat(szMessageStream, szFileInfo);
    }
    ++dwIndex;
    siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
  }

  if(*szMessageStream != '\0')
    AppendToGlobalMessageStream(szMessageStream);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogMSDownloadProtocol ( DWORD  dwProtocolType)

Definition at line 497 of file logging.c.

{
  char szMessageStream[MAX_BUF_TINY];
  char szProtocolType[MAX_BUF];

  switch(dwProtocolType)
  {
    case UP_HTTP:
      lstrcpy(szProtocolType, "HTTP");
      break;

    default:
      lstrcpy(szProtocolType, "FTP");
      break;
  }

  wsprintf(szMessageStream, "&DownloadProtocol=%s", szProtocolType);
  AppendToGlobalMessageStream(szMessageStream);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogMSDownloadStatus ( int  iDownloadStatus)

Definition at line 517 of file logging.c.

{
  char szMessageStream[MAX_BUF_TINY];

  wsprintf(szMessageStream, "&DownloadStatus=%d", iDownloadStatus);
  AppendToGlobalMessageStream(szMessageStream);
  gErrorMessageStream.bSendMessage = TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 470 of file logging.c.

{
  char szBuf[MAX_BUF];
  char szOSType[MAX_BUF_TINY];

  GetOSTypeString(szOSType, sizeof(szOSType));
  if(*gSystemInfo.szExtraString != '\0')
    wsprintf(szBuf, "UserAgent=%s/%s (%s,%d.%d.%d,%s)",
             sgProduct.szProductName,
             sgProduct.szUserAgent,
             szOSType,
             gSystemInfo.dwMajorVersion,
             gSystemInfo.dwMinorVersion,
             gSystemInfo.dwBuildNumber,
             gSystemInfo.szExtraString);
  else
    wsprintf(szBuf, "UserAgent=%s/%s (%s,%d.%d.%d)",
             sgProduct.szProductName,
             sgProduct.szUserAgent,
             szOSType,
             gSystemInfo.dwMajorVersion,
             gSystemInfo.dwMinorVersion,
             gSystemInfo.dwBuildNumber);

  AppendToGlobalMessageStream(szBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogMSTurboMode ( BOOL  bTurboMode)

Definition at line 583 of file logging.c.

{
  char szMessageStream[MAX_BUF];

  wsprintf(szMessageStream, "&TM=%d", bTurboMode);
  AppendToGlobalMessageStream(szMessageStream);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LogMSXPInstallStatus ( char *  szFile,
int  iErr 
)

Definition at line 560 of file logging.c.

{
  char szMessageStream[MAX_BUF];
  static BOOL bAlreadyLogged = FALSE;

  if(bAlreadyLogged)
    return;

  if(szFile)
    wsprintf(szMessageStream, "&XPInstallStatus=%d&XPInstallFile=%s", iErr, szFile);
  else
    wsprintf(szMessageStream, "&XPInstallStatus=%d", iErr);

  AppendToGlobalMessageStream(szMessageStream);
  bAlreadyLogged = TRUE;
  if((iErr != E_REBOOT) &&
    (((iErr == E_USER_CANCEL) &&
       !gErrorMessageStream.bShowConfirmation) ||
     ((iErr != E_USER_CANCEL) &&
      (iErr != WIZ_OK))))
    gErrorMessageStream.bSendMessage = TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function: