Changeset 20859 in vbox
- Timestamp:
- Jun 23, 2009 5:29:34 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
include/iprt/log.h (modified) (10 diffs)
-
src/VBox/Runtime/common/log/log.cpp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/log.h
r20853 r20859 220 220 /** Pointer to temporary scratch buffer. 221 221 * This is used to format the log messages. */ 222 char achScratch[ 16384];222 char achScratch[32768]; 223 223 /** Current scratch buffer position. */ 224 RTUINToffScratch;224 uint32_t offScratch; 225 225 /** This is set if a prefix is pending. */ 226 RTUINTfPendingPrefix;226 uint32_t fPendingPrefix; 227 227 /** Pointer to the logger function. 228 228 * This is actually pointer to a wrapper which will push a pointer to the … … 235 235 uint32_t u32Magic; 236 236 /** Logger instance flags - RTLOGFLAGS. */ 237 RTUINTfFlags;237 uint32_t fFlags; 238 238 /** Number of groups in the afGroups member. */ 239 RTUINTcGroups;239 uint32_t cGroups; 240 240 /** Group flags array - RTLOGGRPFLAGS. 241 241 * This member have variable length and may extend way beyond 242 242 * the declared size of 1 entry. */ 243 RTUINTafGroups[1];243 uint32_t afGroups[1]; 244 244 }; 245 245 … … 257 257 /** Pointer to temporary scratch buffer. 258 258 * This is used to format the log messages. */ 259 char achScratch[ 16384];259 char achScratch[32768]; 260 260 /** Current scratch buffer position. */ 261 RTUINToffScratch;261 uint32_t offScratch; 262 262 /** This is set if a prefix is pending. */ 263 RTUINTfPendingPrefix;263 uint32_t fPendingPrefix; 264 264 /** Pointer to the logger function. 265 265 * This is actually pointer to a wrapper which will push a pointer to the … … 279 279 uint32_t u32Magic; 280 280 /** Logger instance flags - RTLOGFLAGS. */ 281 RTUINTfFlags;281 uint32_t fFlags; 282 282 /** Destination flags - RTLOGDEST. */ 283 RTUINTfDestFlags;283 uint32_t fDestFlags; 284 284 /** Handle to log file (if open). */ 285 285 RTFILE File; … … 292 292 /** The max number of groups that there is room for in afGroups and papszGroups. 293 293 * Used by RTLogCopyGroupAndFlags(). */ 294 RTUINTcMaxGroups;294 uint32_t cMaxGroups; 295 295 /** Number of groups in the afGroups and papszGroups members. */ 296 RTUINTcGroups;296 uint32_t cGroups; 297 297 /** Group flags array - RTLOGGRPFLAGS. 298 298 * This member have variable length and may extend way beyond 299 299 * the declared size of 1 entry. */ 300 RTUINTafGroups[1];300 uint32_t afGroups[1]; 301 301 }; 302 302 … … 1313 1313 * @param ... Format arguments. 1314 1314 */ 1315 RTDECL(int) RTLogCreate(PRTLOGGER *ppLogger, RTUINTfFlags, const char *pszGroupSettings,1315 RTDECL(int) RTLogCreate(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings, 1316 1316 const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups, 1317 RTUINTfDestFlags, const char *pszFilenameFmt, ...);1317 uint32_t fDestFlags, const char *pszFilenameFmt, ...); 1318 1318 1319 1319 /** … … 1335 1335 * @param ... Format arguments. 1336 1336 */ 1337 RTDECL(int) RTLogCreateEx(PRTLOGGER *ppLogger, RTUINTfFlags, const char *pszGroupSettings,1337 RTDECL(int) RTLogCreateEx(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings, 1338 1338 const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups, 1339 RTUINTfDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, ...);1339 uint32_t fDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, ...); 1340 1340 1341 1341 /** … … 1357 1357 * @param args Format arguments. 1358 1358 */ 1359 RTDECL(int) RTLogCreateExV(PRTLOGGER *ppLogger, RTUINTfFlags, const char *pszGroupSettings,1359 RTDECL(int) RTLogCreateExV(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings, 1360 1360 const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups, 1361 RTUINTfDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, va_list args);1361 uint32_t fDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, va_list args); 1362 1362 1363 1363 /** … … 1373 1373 * @param fDestFlags The destination flags. 1374 1374 */ 1375 RTDECL(int) RTLogCreateForR0(PRTLOGGER pLogger, size_t cbLogger, PFNRTLOGGER pfnLogger, PFNRTLOGFLUSH pfnFlush, RTUINT fFlags, RTUINTfDestFlags);1375 RTDECL(int) RTLogCreateForR0(PRTLOGGER pLogger, size_t cbLogger, PFNRTLOGGER pfnLogger, PFNRTLOGFLUSH pfnFlush, uint32_t fFlags, uint32_t fDestFlags); 1376 1376 1377 1377 /** … … 1400 1400 */ 1401 1401 RTDECL(int) RTLogCloneRC(PRTLOGGER pLogger, PRTLOGGERRC pLoggerRC, size_t cbLoggerRC, 1402 RTRCPTR pfnLoggerRCPtr, RTRCPTR pfnFlushRCPtr, RTUINTfFlags);1402 RTRCPTR pfnLoggerRCPtr, RTRCPTR pfnFlushRCPtr, uint32_t fFlags); 1403 1403 1404 1404 /** -
trunk/src/VBox/Runtime/common/log/log.cpp
r20853 r20859 192 192 * @param ... Format arguments. 193 193 */ 194 RTDECL(int) RTLogCreateExV(PRTLOGGER *ppLogger, RTUINTfFlags, const char *pszGroupSettings,194 RTDECL(int) RTLogCreateExV(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings, 195 195 const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups, 196 RTUINTfDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, va_list args)196 uint32_t fDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, va_list args) 197 197 { 198 198 int rc; … … 505 505 * @param ... Format arguments. 506 506 */ 507 RTDECL(int) RTLogCreate(PRTLOGGER *ppLogger, RTUINTfFlags, const char *pszGroupSettings,507 RTDECL(int) RTLogCreate(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings, 508 508 const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups, 509 RTUINTfDestFlags, const char *pszFilenameFmt, ...)509 uint32_t fDestFlags, const char *pszFilenameFmt, ...) 510 510 { 511 511 va_list args; … … 536 536 * @param ... Format arguments. 537 537 */ 538 RTDECL(int) RTLogCreateEx(PRTLOGGER *ppLogger, RTUINTfFlags, const char *pszGroupSettings,538 RTDECL(int) RTLogCreateEx(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings, 539 539 const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups, 540 RTUINTfDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, ...)540 uint32_t fDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, ...) 541 541 { 542 542 va_list args; … … 560 560 { 561 561 int rc; 562 RTUINTiGroup;562 uint32_t iGroup; 563 563 RTSEMFASTMUTEX MutexSem; 564 564 … … 642 642 */ 643 643 RTDECL(int) RTLogCloneRC(PRTLOGGER pLogger, PRTLOGGERRC pLoggerRC, size_t cbLoggerRC, 644 RTRCPTR pfnLoggerRCPtr, RTRCPTR pfnFlushRCPtr, RTUINTfFlags)644 RTRCPTR pfnLoggerRCPtr, RTRCPTR pfnFlushRCPtr, uint32_t fFlags) 645 645 { 646 646 /* … … 779 779 * @param fDestFlags The destination flags. 780 780 */ 781 RTDECL(int) RTLogCreateForR0(PRTLOGGER pLogger, size_t cbLogger, PFNRTLOGGER pfnLogger, PFNRTLOGFLUSH pfnFlush, RTUINT fFlags, RTUINT fDestFlags) 781 RTDECL(int) RTLogCreateForR0(PRTLOGGER pLogger, size_t cbLogger, PFNRTLOGGER pfnLogger, PFNRTLOGFLUSH pfnFlush, 782 uint32_t fFlags, uint32_t fDestFlags) 782 783 { 783 784 /* … … 803 804 pLogger->pszFilename = NULL; 804 805 pLogger->papszGroups = NULL; 805 pLogger->cMaxGroups = ( RTUINT)((cbLogger - RT_OFFSETOF(RTLOGGER, afGroups[0])) / sizeof(pLogger->afGroups[0]));806 pLogger->cMaxGroups = (uint32_t)((cbLogger - RT_OFFSETOF(RTLOGGER, afGroups[0])) / sizeof(pLogger->afGroups[0])); 806 807 pLogger->cGroups = 1; 807 808 pLogger->afGroups[0] = 0; … … 1756 1757 uint32_t cb = sizeof(pThis->achScratch) - pThis->offScratch - 1; /* minus 1 - for the string terminator. */ 1757 1758 if (cb > cbChars) 1758 cb = ( RTUINT)cbChars;1759 cb = (uint32_t)cbChars; 1759 1760 1760 1761 /* copy */ … … 1900 1901 1901 1902 /* advance */ 1902 pLogger->offScratch += ( RTUINT)cb;1903 pLogger->offScratch += (uint32_t)cb; 1903 1904 cbRet += cb; 1904 1905 cbChars -= cb; … … 2258 2259 cb = psz - &pLogger->achScratch[pLogger->offScratch]; 2259 2260 Assert(cb <= 198); 2260 pLogger->offScratch += ( RTUINT)cb;2261 pLogger->offScratch += (uint32_t)cb; 2261 2262 cb = sizeof(pLogger->achScratch) - pLogger->offScratch - 1; 2262 2263 } … … 2298 2299 2299 2300 /* advance */ 2300 pLogger->offScratch += ( RTUINT)cb;2301 pLogger->offScratch += (uint32_t)cb; 2301 2302 cbRet += cb; 2302 2303 cbChars -= cb;
Note:
See TracChangeset
for help on using the changeset viewer.

