VirtualBox

Changeset 91004 in vbox for trunk/src


Ignore:
Timestamp:
Aug 30, 2021 4:03:15 PM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: Better verbosity flag handling for VKAT. ​bugref:10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp

    r90979 r91004  
    12891289
    12901290    /*
    1291      * Daemonize ourselves if asked to.
     1291     * Handle special command line options which need parsing before
     1292     * everything else.
    12921293     */
    12931294    bool fDaemonize  = false;
    12941295    bool fDaemonized = false;
    12951296
    1296     for (int i = 1; i < argc; i++)
    1297     {
    1298         const char *psz = argv[i];
    1299         if (!RTStrICmp(psz, "--daemonize"))
    1300         {
    1301             fDaemonize = true;
    1302             continue;
    1303         }
    1304         else if (!RTStrICmp(psz, "--daemonized"))
    1305         {
    1306             fDaemonized = true;
    1307             continue;
     1297    RTGETOPTSTATE GetState;
     1298    rc = RTGetOptInit(&GetState, argc, argv, g_aCmdCommonOptions,
     1299                      RT_ELEMENTS(g_aCmdCommonOptions), 1 /*idxFirst*/, 0 /*fFlags - must not sort! */);
     1300    AssertRCReturn(rc, RTEXITCODE_INIT);
     1301
     1302    int           ch;
     1303    RTGETOPTUNION ValueUnion;
     1304    while ((ch = RTGetOpt(&GetState, &ValueUnion)) != 0)
     1305    {
     1306        switch (ch)
     1307        {
     1308            case AUDIO_TEST_OPT_CMN_DAEMONIZE:
     1309                fDaemonize = true;
     1310                break;
     1311
     1312            case AUDIO_TEST_OPT_CMN_DAEMONIZED:
     1313                fDaemonized = true;
     1314                break;
     1315
     1316            case 'v':
     1317                g_uVerbosity++;
     1318                break;
     1319
     1320            default:
     1321                break;
    13081322        }
    13091323    }
     
    13501364                     RT_ELEMENTS(g_apszLogGroups), g_apszLogGroups, RTLOGDEST_STDERR, NULL /*"vkat-release.log"*/);
    13511365    if (RT_SUCCESS(rc))
     1366    {
    13521367        RTLogRelSetDefaultInstance(g_pRelLogger);
     1368        if (g_uVerbosity)
     1369        {
     1370            RTMsgInfo("Setting verbosity logging to level %u\n", g_uVerbosity);
     1371            rc = RTLogGroupSettings(g_pRelLogger,
     1372                                    "drv_audio.e.l.l2.l3.f"
     1373                                    " audio_mixer.e.l.l2.l3.f"
     1374                                    " audio_test.e.l.l2.l3.f");
     1375            if (RT_FAILURE(rc))
     1376                RTMsgError("Setting debug logging failed, rc=%Rrc\n", rc);
     1377        }
     1378    }
    13531379    else
    13541380        RTMsgWarning("Failed to create release logger: %Rrc", rc);
     
    13691395     * Process common options.
    13701396     */
    1371     RTGETOPTSTATE GetState;
     1397    RT_ZERO(GetState);
    13721398    rc = RTGetOptInit(&GetState, argc, argv, g_aCmdCommonOptions,
    13731399                      RT_ELEMENTS(g_aCmdCommonOptions), 1 /*idxFirst*/, 0 /*fFlags - must not sort! */);
    13741400    AssertRCReturn(rc, RTEXITCODE_INIT);
    13751401
    1376     int           ch;
    1377     RTGETOPTUNION ValueUnion;
    13781402    while ((ch = RTGetOpt(&GetState, &ValueUnion)) != 0)
    13791403    {
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