VirtualBox

Ignore:
Timestamp:
May 9, 2023 8:28:38 AM (22 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
157237
Message:

Guest Additions/VBoxClient: Dropped the idea of having an own logging facility (VBGHLogXXX) for shared guest/host code again; the (release) logger is flexible enough for this. bugref:10427

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/main.cpp

    r99660 r99689  
    674674                if (RT_SUCCESS(rc))
    675675                {
    676                     VBGHLogVerbositySet(2);
    677                     VBGHDISPLAYSERVERTYPE const enmType = VBGHDisplayServerTypeDetect();
    678                     VBClLogInfo("Detected session: %s\n", VBGHDisplayServerTypeToStr(enmType));
    679                     return enmType != VBGHDISPLAYSERVERTYPE_NONE ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
     676                    /* Make sure that we increase the verbosity (if needed), to gain some more insights
     677                     * when detecting the display server. */
     678                    rc = VBClLogModify("stdout", g_cVerbosity);
     679                    if (RT_SUCCESS(rc))
     680                    {
     681                        VBGHDISPLAYSERVERTYPE const enmType = VBGHDisplayServerTypeDetect();
     682                        VBClLogInfo("Detected session: %s\n", VBGHDisplayServerTypeToStr(enmType));
     683                        return enmType != VBGHDISPLAYSERVERTYPE_NONE ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
     684                    }
    680685                }
    681686
     
    740745        return RTEXITCODE_FAILURE; /* Error message already printed in VBClLogCreateEx(). */
    741746
    742     if (!fDaemonise)
    743     {
    744         /* If the user is running in "no daemon" mode, send critical logging to stdout as well. */
    745         PRTLOGGER pReleaseLog = RTLogRelGetDefaultInstance();
    746         if (pReleaseLog)
    747         {
    748             rc = RTLogDestinations(pReleaseLog, "stdout");
    749             if (RT_FAILURE(rc))
    750                 return RTMsgErrorExitFailure("Failed to redivert error output, rc=%Rrc", rc);
    751         }
    752     }
     747    /* If the user is running in "no daemon" mode, send critical logging to stdout as well. */
     748    rc = VBClLogModify(fDaemonise ? "" : "stdout", g_cVerbosity);
     749    if (RT_FAILURE(rc))
     750        return RTEXITCODE_FAILURE; /* Error message already printed in VBClLogModify(). */
    753751
    754752    VBClLogInfo("VBoxClient %s r%s started. Verbose level = %d\n",
    755753                RTBldCfgVersion(), RTBldCfgRevisionStr(), g_cVerbosity);
    756 
    757     VBGHLogVerbositySet(g_cVerbosity);
    758754
    759755    /* Try to detect the current session type early on, if needed. */
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