VirtualBox

Changeset 90711 in vbox


Ignore:
Timestamp:
Aug 17, 2021 8:26:02 PM (3 years ago)
Author:
vboxsync
Message:

VBoxTray: Explain the 'release' log stuff for DEBUG builds when it isn't a release log at all.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp

    r90710 r90711  
    4848#include <iprt/time.h>
    4949
    50 #ifdef DEBUG
    51 # define LOG_ENABLED
    52 # define LOG_GROUP LOG_GROUP_DEFAULT
    53 #endif
    5450#include <VBox/log.h>
    55 
    5651#include <VBox/err.h>
    5752
     
    146141uint32_t              g_fGuestDisplaysChanged = 0;
    147142
    148 static PRTLOGGER      g_pLoggerRelease = NULL;
    149 static uint32_t       g_cHistory = 10;                   /* Enable log rotation, 10 files. */
    150 static uint32_t       g_uHistoryFileTime = RT_SEC_1DAY;  /* Max 1 day per file. */
    151 static uint64_t       g_uHistoryFileSize = 100 * _1M;    /* Max 100MB per file. */
     143static PRTLOGGER      g_pLoggerRelease = NULL;           /**< This is actually the debug logger in DEBUG builds! */
     144static uint32_t       g_cHistory = 10;                   /**< Enable log rotation, 10 files. */
     145static uint32_t       g_uHistoryFileTime = RT_SEC_1DAY;  /**< Max 1 day per file. */
     146static uint64_t       g_uHistoryFileSize = 100 * _1M;    /**< Max 100MB per file. */
    152147
    153148#ifdef DEBUG_andy
     
    570565static int vboxTrayLogCreate(void)
    571566{
    572     /* Create release logger (stdout + file). */
     567    /* Create release (or debug) logger (stdout + file). */
    573568    static const char * const s_apszGroups[] = VBOX_LOGGROUP_NAMES;
    574     RTUINT fFlags = RTLOGFLAGS_PREFIX_THREAD | RTLOGFLAGS_PREFIX_TIME_PROG;
    575 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    576     fFlags |= RTLOGFLAGS_USECRLF;
    577 #endif
    578569    RTERRINFOSTATIC ErrInfo;
    579     int rc = RTLogCreateEx(&g_pLoggerRelease, fFlags,
    580 #ifdef DEBUG
     570    int rc = RTLogCreateEx(&g_pLoggerRelease, RTLOGFLAGS_PREFIX_THREAD | RTLOGFLAGS_PREFIX_TIME_PROG | RTLOGFLAGS_USECRLF,
     571#ifdef DEBUG /* See below, debug logger not release. */
    581572                           "all.e.l.f",
    582573                           "VBOXTRAY_LOG",
     
    591582    {
    592583#ifdef DEBUG
     584        /* Register this logger as the _debug_ logger.
     585           Note! This means any Log() statement preceeding this may cause a
     586                 20yy-*VBoxTray*.log file to have been created and it will stay
     587                 open till the process quits as we don't destroy it when
     588                 replacing it here. */
    593589        RTLogSetDefaultInstance(g_pLoggerRelease);
    594590#else
     
    607603static void vboxTrayLogDestroy(void)
    608604{
     605    /* Only want to destroy the release logger before calling exit(). The debug
     606       logger can be useful after that point... */
    609607    RTLogDestroy(RTLogRelSetDefaultInstance(NULL));
    610608}
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