VirtualBox

Changeset 24696 in vbox for trunk


Ignore:
Timestamp:
Nov 16, 2009 2:52:07 PM (15 years ago)
Author:
vboxsync
Message:

VBoxTestGL: logging make the log file name be suffexed with 'RTTimeMilliTS().log' when specified via VBOXGLTEST_LOG env var to avoid undisired log file overwrites

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/generic/OpenGLTestApp.cpp

    r24694 r24696  
    111111
    112112#ifdef VBOXGLTEST_WITH_LOGGING
    113 static int vboxInitLogging(const char *pszFilename)
     113static int vboxInitLogging(const char *pszFilename, bool bGenNameSuffix)
    114114{
    115115    PRTLOGGER loggerRelease;
     
    124124    if(pszFilename)
    125125    {
    126         pszFilenameFmt = "%s";
     126        if(bGenNameSuffix)
     127            pszFilenameFmt = "%s.%ld.log";
     128        else
     129            pszFilenameFmt = "%s";
    127130        enmLogDest = RTLOGDEST_FILE;
    128131    }
     
    135138    int vrc = RTLogCreateEx(&loggerRelease, fFlags, "all",
    136139                            "VBOX_RELEASE_LOG", RT_ELEMENTS(s_apszGroups), s_apszGroups,
    137                             RTLOGDEST_FILE, szError, sizeof(szError), pszFilenameFmt, pszFilename);
     140                            enmLogDest, szError, sizeof(szError), pszFilenameFmt, pszFilename, RTTimeMilliTS());
    138141    if (RT_SUCCESS(vrc))
    139142    {
     
    242245#ifdef VBOXGLTEST_WITH_LOGGING
    243246        bool bLog = false;
     247        bool bLogSuffix = false;
    244248        const char * pLog;
    245249#endif
     
    322326                if(pLog)
    323327                    bLog = true;
     328                bLogSuffix = true;
    324329            }
    325330            if(bLog)
    326                 rc = vboxInitLogging(pLog);
     331                rc = vboxInitLogging(pLog, bLogSuffix);
    327332            else
    328333#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette