Changeset 90860 in vbox for trunk/src/VBox
- Timestamp:
- Aug 24, 2021 9:41:49 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/log/log.cpp
r90858 r90860 1236 1236 RT_EXPORT_SYMBOL(RTLogSetCustomPrefixCallback); 1237 1237 1238 /** 1239 * Sets the custom prefix callback. 1238 1239 /** 1240 * Sets the custom flush callback. 1241 * 1242 * This can be handy for special loggers like the per-EMT ones in ring-0, 1243 * but also for implementing a log viewer in the debugger GUI. 1240 1244 * 1241 1245 * @returns IPRT status code. 1242 * @param pLogger The logger instance. 1243 * @param pfnCallback The callback. 1244 * @param pvUser The user argument for the callback. 1245 * */ 1246 RTDECL(int) RTLogSetFlushCallback(PRTLOGGER pLogger, PFNRTLOGFLUSH pfnFlush, PFNRTLOGFLUSH *ppfnOldFlush) 1247 { 1246 * @retval VWRN_ALREADY_EXISTS if it was set to a different flusher. 1247 * @param pLogger The logger instance. 1248 * @param pfnFlush The flush callback. 1249 */ 1250 RTDECL(int) RTLogSetFlushCallback(PRTLOGGER pLogger, PFNRTLOGFLUSH pfnFlush) 1251 { 1252 int rc; 1253 1248 1254 /* 1249 1255 * Resolve defaults. … … 1261 1267 * Do the work. 1262 1268 */ 1263 rtlogLock(pLoggerInt); 1264 if (ppfnOldFlush) 1265 *ppfnOldFlush = pLoggerInt->pfnFlush; 1266 pLoggerInt->pfnFlush = pfnFlush; 1267 rtlogUnlock(pLoggerInt); 1268 1269 return VINF_SUCCESS; 1269 rc = rtlogLock(pLoggerInt); 1270 if (RT_SUCCESS(rc)) 1271 { 1272 if (pLoggerInt->pfnFlush && pLoggerInt->pfnFlush != pfnFlush) 1273 rc = VWRN_ALREADY_EXISTS; 1274 pLoggerInt->pfnFlush = pfnFlush; 1275 rtlogUnlock(pLoggerInt); 1276 } 1277 1278 return rc; 1270 1279 } 1271 1280 RT_EXPORT_SYMBOL(RTLogSetFlushCallback);
Note:
See TracChangeset
for help on using the changeset viewer.