Changeset 36408 in vbox for trunk/include/iprt
- Timestamp:
- Mar 24, 2011 4:25:47 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70763
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/log.h
r36344 r36408 178 178 RTLOGPHASE_PREROTATE, 179 179 /** After rotating the log file. */ 180 RTLOGPHASE_POSTROTATE 180 RTLOGPHASE_POSTROTATE, 181 /** 32-bit type blow up hack. */ 182 RTLOGPHASE_32BIT_HACK = 0x7fffffff 181 183 } RTLOGPHASE; 182 184 … … 224 226 * Log file header/footer callback. 225 227 * 226 * @param pLogger Pointer to the logger instance. 227 * @param enmLogPhase Indicates at what time the callback is invoked. 228 * @param pLogger Pointer to the logger instance. 229 * @param enmLogPhase Indicates at what time the callback is invoked. 230 * @param pfnLogPhaseMsg Callback for writing the header/footer (RTLogPrintf 231 * and others are out of bounds). 228 232 */ 229 233 typedef DECLCALLBACK(void) FNRTLOGPHASE(PRTLOGGER pLogger, RTLOGPHASE enmLogPhase, PFNRTLOGPHASEMSG pfnLogPhaseMsg); … … 287 291 #ifndef IN_RC 288 292 289 #ifdef IN_RING3290 /**291 * File logging bits for the logger.292 */293 typedef struct RTLOGGERFILE294 {295 /** Pointer to the function called when starting logging, and when296 * ending or starting a new log file as part of history rotation. */297 PFNRTLOGPHASE pfnPhase;298 /** Handle to log file (if open). */299 RTFILE File;300 /** Pointer to filename.301 * (The memory is allocated in the same block as RTLOGGER.) */302 char *pszFilename;303 /** Log file history settings: number of older files to keep.304 * 0 means no history. */305 uint32_t cHistory;306 /** Log file history settings: maximum amount of data to put in a file. */307 uint64_t cbHistoryFileMax;308 /** Log file history settings: current amount of data in a file. */309 uint64_t cbHistoryFileWritten;310 /** Log file history settings: maximum time to use a file. */311 uint32_t uHistoryTimeSlotLength;312 /** Log file history settings: in what time slot was the file created. */313 uint32_t uHistoryTimeSlotStart;314 } RTLOGGERFILE;315 #else /* !IN_RING3 */316 typedef void RTLOGGERFILE;317 #endif /* !IN_RING3 */318 293 /** Pointer to file logging bits for the logger. */ 319 typedef RTLOGGERFILE *PRTLOGGERFILE;294 typedef struct RTLOGGERFILE *PRTLOGGERFILE; 320 295 321 296 /** … … 351 326 /** Destination flags - RTLOGDEST. */ 352 327 uint32_t fDestFlags; 353 /** currently unused field. */328 /** Currently unused field. */ 354 329 uint32_t uUnused; 355 330 /** Pointer to the file related logging information. … … 1450 1425 * 1451 1426 * @param ppLogger Where to store the logger instance. 1452 * @param fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values. 1427 * @param fFlags Logger instance flags, a combination of the 1428 * RTLOGFLAGS_* values. 1453 1429 * @param pszGroupSettings The initial group settings. 1454 * @param pszEnvVarBase Base name for the environment variables for this instance. 1430 * @param pszEnvVarBase Base name for the environment variables for 1431 * this instance. 1455 1432 * @param cGroups Number of groups in the array. 1456 * @param papszGroups Pointer to array of groups. This must stick around for the life of the 1457 * logger instance. 1458 * @param fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified. 1459 * @param pfnPhase Callback function for starting logging and for ending or starting a new file for log history rotation. 1460 * @param cHistory Number of old log files to keep when performing log history rotation. 1461 * @param cbHistoryFileMax Maximum size of log file when performing history rotation. 0=no size limit. 1462 * @param uHistoryTimeSlotLength Maximum time interval per log file when performing history rotation, in seconds. 0=no time limit. 1463 * @param pszFilenameFmt Log filename format string. Standard RTStrFormat(). 1433 * @param papszGroups Pointer to array of groups. This must stick 1434 * around for the life of the logger instance. 1435 * @param fDestFlags The destination flags. RTLOGDEST_FILE is ORed 1436 * if pszFilenameFmt specified. 1437 * @param pszFilenameFmt Log filename format string. Standard 1438 * RTStrFormat(). 1464 1439 * @param ... Format arguments. 1465 1440 */ 1466 1441 RTDECL(int) RTLogCreate(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings, 1467 1442 const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups, 1468 uint32_t fDestFlags, PFNRTLOGPHASE pfnPhase, uint32_t cHistory, 1469 uint64_t cbHistoryFileMax, uint32_t uHistoryTimeSlotLength, 1470 const char *pszFilenameFmt, ...); 1443 uint32_t fDestFlags, const char *pszFilenameFmt, ...); 1471 1444 1472 1445 /** … … 1476 1449 * 1477 1450 * @param ppLogger Where to store the logger instance. 1478 * @param fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values. 1451 * @param fFlags Logger instance flags, a combination of the 1452 * RTLOGFLAGS_* values. 1479 1453 * @param pszGroupSettings The initial group settings. 1480 * @param pszEnvVarBase Base name for the environment variables for this instance. 1454 * @param pszEnvVarBase Base name for the environment variables for 1455 * this instance. 1481 1456 * @param cGroups Number of groups in the array. 1482 * @param papszGroups Pointer to array of groups. This must stick around for the life of the 1483 * logger instance. 1484 * @param fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified. 1485 * @param pfnPhase Callback function for starting logging and for ending or starting a new file for log history rotation. 1486 * @param cHistory Number of old log files to keep when performing log history rotation. 1487 * @param cbHistoryFileMax Maximum size of log file when performing history rotation. 0=no size limit. 1488 * @param uHistoryTimeSlotLength Maximum time interval per log file when performing history rotation, in seconds. 0=no time limit. 1457 * @param papszGroups Pointer to array of groups. This must stick 1458 * around for the life of the logger instance. 1459 * @param fDestFlags The destination flags. RTLOGDEST_FILE is ORed 1460 * if pszFilenameFmt specified. 1461 * @param pfnPhase Callback function for starting logging and for 1462 * ending or starting a new file for log history 1463 * rotation. NULL is OK. 1464 * @param cHistory Number of old log files to keep when performing 1465 * log history rotation. 0 means no history. 1466 * @param cbHistoryFileMax Maximum size of log file when performing 1467 * history rotation. 0 means no size limit. 1468 * @param cSecsHistoryTimeSlot Maximum time interval per log file when 1469 * performing history rotation, in seconds. 1470 * 0 means time limit. 1489 1471 * @param pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL. 1490 1472 * @param cchErrorMsg The size of the error message buffer. … … 1495 1477 const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups, 1496 1478 uint32_t fDestFlags, PFNRTLOGPHASE pfnPhase, uint32_t cHistory, 1497 uint64_t cbHistoryFileMax, uint32_t uHistoryTimeSlotLength,1479 uint64_t cbHistoryFileMax, uint32_t cSecsHistoryTimeSlot, 1498 1480 char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, ...); 1499 1481 … … 1504 1486 * 1505 1487 * @param ppLogger Where to store the logger instance. 1506 * @param fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values. 1488 * @param fFlags Logger instance flags, a combination of the 1489 * RTLOGFLAGS_* values. 1507 1490 * @param pszGroupSettings The initial group settings. 1508 * @param pszEnvVarBase Base name for the environment variables for this instance. 1491 * @param pszEnvVarBase Base name for the environment variables for 1492 * this instance. 1509 1493 * @param cGroups Number of groups in the array. 1510 * @param papszGroups Pointer to array of groups. This must stick around for the life of the 1511 * logger instance. 1512 * @param fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified. 1513 * @param pfnPhase Callback function for starting logging and for ending or starting a new file for log history rotation. 1514 * @param cHistory Number of old log files to keep when performing log history rotation. 1515 * @param cbHistoryFileMax Maximum size of log file when performing history rotation. 0=no size limit. 1516 * @param uHistoryTimeSlotLength Maximum time interval per log file when performing history rotation, in seconds. 0=no time limit. 1517 * @param pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL. 1494 * @param papszGroups Pointer to array of groups. This must stick 1495 * around for the life of the logger instance. 1496 * @param fDestFlags The destination flags. RTLOGDEST_FILE is ORed 1497 * if pszFilenameFmt specified. 1498 * @param pfnPhase Callback function for starting logging and for 1499 * ending or starting a new file for log history 1500 * rotation. 1501 * @param cHistory Number of old log files to keep when performing 1502 * log history rotation. 0 means no history. 1503 * @param cbHistoryFileMax Maximum size of log file when performing 1504 * history rotation. 0 means no size limit. 1505 * @param cSecsHistoryTimeSlot Maximum time interval per log file when 1506 * performing history rotation, in seconds. 1507 * 0 means no time limit. 1508 * @param pszErrorMsg A buffer which is filled with an error message 1509 * if something fails. May be NULL. 1518 1510 * @param cchErrorMsg The size of the error message buffer. 1519 * @param pszFilenameFmt Log filename format string. Standard RTStrFormat(). 1511 * @param pszFilenameFmt Log filename format string. Standard 1512 * RTStrFormat(). 1520 1513 * @param args Format arguments. 1521 1514 */ … … 1523 1516 const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups, 1524 1517 uint32_t fDestFlags, PFNRTLOGPHASE pfnPhase, uint32_t cHistory, 1525 uint64_t cbHistoryFileMax, uint32_t uHistoryTimeSlotLength,1518 uint64_t cbHistoryFileMax, uint32_t cSecsHistoryTimeSlot, 1526 1519 char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, va_list args); 1527 1520
Note:
See TracChangeset
for help on using the changeset viewer.