vbox的更動 36344 路徑 trunk/include
- 時間撮記:
- 2011-3-22 下午02:29:37 (14 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/include/iprt/log.h
r33540 r36344 4 4 5 5 /* 6 * Copyright (C) 2006-20 07Oracle Corporation6 * Copyright (C) 2006-2011 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 165 165 166 166 /** 167 * Logger phase. 168 * 169 * Used for signalling the log header/footer callback what to do. 170 */ 171 typedef enum RTLOGPHASE 172 { 173 /** Begin of the logging. */ 174 RTLOGPHASE_BEGIN = 0, 175 /** End of the logging. */ 176 RTLOGPHASE_END, 177 /** Before rotating the log file. */ 178 RTLOGPHASE_PREROTATE, 179 /** After rotating the log file. */ 180 RTLOGPHASE_POSTROTATE 181 } RTLOGPHASE; 182 183 184 /** 167 185 * Logger function. 168 186 * … … 191 209 /** Pointer to logger function. */ 192 210 typedef RCPTRTYPE(FNRTLOGFLUSHGC *) PFNRTLOGFLUSHGC; 211 212 /** 213 * Header/footer message callback. 214 * 215 * @param pLogger Pointer to the logger instance. 216 * @param pszFormat Format string. 217 * @param ... Optional arguments specified in the format string. 218 */ 219 typedef DECLCALLBACK(void) FNRTLOGPHASEMSG(PRTLOGGER pLogger, const char *pszFormat, ...); 220 /** Pointer to header/footer message callback function. */ 221 typedef FNRTLOGPHASEMSG *PFNRTLOGPHASEMSG; 222 223 /** 224 * Log file header/footer callback. 225 * 226 * @param pLogger Pointer to the logger instance. 227 * @param enmLogPhase Indicates at what time the callback is invoked. 228 */ 229 typedef DECLCALLBACK(void) FNRTLOGPHASE(PRTLOGGER pLogger, RTLOGPHASE enmLogPhase, PFNRTLOGPHASEMSG pfnLogPhaseMsg); 230 /** Pointer to log header/footer callback function. */ 231 typedef FNRTLOGPHASE *PFNRTLOGPHASE; 193 232 194 233 /** … … 247 286 248 287 #ifndef IN_RC 288 289 #ifdef IN_RING3 290 /** 291 * File logging bits for the logger. 292 */ 293 typedef struct RTLOGGERFILE 294 { 295 /** Pointer to the function called when starting logging, and when 296 * 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 /** Pointer to file logging bits for the logger. */ 319 typedef RTLOGGERFILE *PRTLOGGERFILE; 320 249 321 /** 250 322 * Logger instance structure. … … 279 351 /** Destination flags - RTLOGDEST. */ 280 352 uint32_t fDestFlags; 281 /** Handle to log file (if open). */282 RTFILE File;283 /** Pointer to filename.353 /** currently unused field. */ 354 uint32_t uUnused; 355 /** Pointer to the file related logging information. 284 356 * (The memory is allocated in the same block as RTLOGGER.) */ 285 char *pszFilename;357 PRTLOGGERFILE pFile; 286 358 /** Pointer to the group name array. 287 359 * (The data is readonly and provided by the user.) */ … … 1385 1457 * logger instance. 1386 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. 1387 1463 * @param pszFilenameFmt Log filename format string. Standard RTStrFormat(). 1388 1464 * @param ... Format arguments. … … 1390 1466 RTDECL(int) RTLogCreate(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings, 1391 1467 const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups, 1392 uint32_t fDestFlags, const char *pszFilenameFmt, ...); 1468 uint32_t fDestFlags, PFNRTLOGPHASE pfnPhase, uint32_t cHistory, 1469 uint64_t cbHistoryFileMax, uint32_t uHistoryTimeSlotLength, 1470 const char *pszFilenameFmt, ...); 1393 1471 1394 1472 /** … … 1405 1483 * logger instance. 1406 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. 1407 1489 * @param pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL. 1408 1490 * @param cchErrorMsg The size of the error message buffer. … … 1412 1494 RTDECL(int) RTLogCreateEx(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings, 1413 1495 const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups, 1414 uint32_t fDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, ...); 1496 uint32_t fDestFlags, PFNRTLOGPHASE pfnPhase, uint32_t cHistory, 1497 uint64_t cbHistoryFileMax, uint32_t uHistoryTimeSlotLength, 1498 char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, ...); 1415 1499 1416 1500 /** … … 1427 1511 * logger instance. 1428 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. 1429 1517 * @param pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL. 1430 1518 * @param cchErrorMsg The size of the error message buffer. … … 1434 1522 RTDECL(int) RTLogCreateExV(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings, 1435 1523 const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups, 1436 uint32_t fDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, va_list args); 1524 uint32_t fDestFlags, PFNRTLOGPHASE pfnPhase, uint32_t cHistory, 1525 uint64_t cbHistoryFileMax, uint32_t uHistoryTimeSlotLength, 1526 char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, va_list args); 1437 1527 1438 1528 /**
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器