VirtualBox

Changeset 18188 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Mar 24, 2009 2:38:09 PM (16 years ago)
Author:
vboxsync
Message:

Added RTLogGetDefaultInstance

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/log/log.cpp

    r17416 r18188  
    13951395
    13961396/**
    1397  * Gets the default logger instance.
     1397 * Gets the default logger instance, creating it if necessary.
    13981398 *
    13991399 * @returns Pointer to default logger instance.
     
    14271427    return g_pLogger;
    14281428#endif /* !IN_RC */
     1429}
     1430
     1431
     1432/**
     1433 * Gets the default logger instance.
     1434 *
     1435 * @returns Pointer to default logger instance.
     1436 * @returns NULL if no default logger instance available.
     1437 */
     1438RTDECL(PRTLOGGER)   RTLogGetDefaultInstance(void)
     1439{
     1440#ifdef IN_RC
     1441    return &g_Logger;
     1442#else
     1443# ifdef IN_RING0
     1444    /*
     1445     * Check per thread loggers first.
     1446     */
     1447    if (g_cPerThreadLoggers)
     1448    {
     1449        const RTNATIVETHREAD Self = RTThreadNativeSelf();
     1450        int32_t i = RT_ELEMENTS(g_aPerThreadLoggers);
     1451        while (i-- > 0)
     1452            if (g_aPerThreadLoggers[i].NativeThread == Self)
     1453                return g_aPerThreadLoggers[i].pLogger;
     1454    }
     1455# endif /* IN_RING0 */
     1456
     1457    return g_pLogger;
     1458#endif
    14291459}
    14301460
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette