Changeset 90711 in vbox
- Timestamp:
- Aug 17, 2021 8:26:02 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp
r90710 r90711 48 48 #include <iprt/time.h> 49 49 50 #ifdef DEBUG51 # define LOG_ENABLED52 # define LOG_GROUP LOG_GROUP_DEFAULT53 #endif54 50 #include <VBox/log.h> 55 56 51 #include <VBox/err.h> 57 52 … … 146 141 uint32_t g_fGuestDisplaysChanged = 0; 147 142 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. */143 static PRTLOGGER g_pLoggerRelease = NULL; /**< This is actually the debug logger in DEBUG builds! */ 144 static uint32_t g_cHistory = 10; /**< Enable log rotation, 10 files. */ 145 static uint32_t g_uHistoryFileTime = RT_SEC_1DAY; /**< Max 1 day per file. */ 146 static uint64_t g_uHistoryFileSize = 100 * _1M; /**< Max 100MB per file. */ 152 147 153 148 #ifdef DEBUG_andy … … 570 565 static int vboxTrayLogCreate(void) 571 566 { 572 /* Create release logger (stdout + file). */567 /* Create release (or debug) logger (stdout + file). */ 573 568 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 #endif578 569 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. */ 581 572 "all.e.l.f", 582 573 "VBOXTRAY_LOG", … … 591 582 { 592 583 #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. */ 593 589 RTLogSetDefaultInstance(g_pLoggerRelease); 594 590 #else … … 607 603 static void vboxTrayLogDestroy(void) 608 604 { 605 /* Only want to destroy the release logger before calling exit(). The debug 606 logger can be useful after that point... */ 609 607 RTLogDestroy(RTLogRelSetDefaultInstance(NULL)); 610 608 }
Note:
See TracChangeset
for help on using the changeset viewer.