Changeset 39650 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Dec 16, 2011 11:27:51 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/DBGFLog.cpp
r38838 r39650 26 26 #include <VBox/err.h> 27 27 #include <iprt/assert.h> 28 #include <iprt/string.h> 28 29 29 30 … … 37 38 38 39 /** 40 * Checkes for logger prefixes and selects the right logger. 41 * 42 * @returns Target logger. 43 * @param ppsz Pointer to the string pointer. 44 */ 45 static PRTLOGGER dbgfR3LogResolvedLogger(const char **ppsz) 46 { 47 PRTLOGGER pLogger; 48 const char *psz = *ppsz; 49 if (!strncmp(psz, "release:", sizeof("release:") - 1)) 50 { 51 *ppsz += sizeof("release:") - 1; 52 pLogger = RTLogRelDefaultInstance(); 53 } 54 else 55 { 56 if (!strncmp(psz, "debug:", sizeof("debug:") - 1)) 57 *ppsz += sizeof("debug:") - 1; 58 pLogger = RTLogDefaultInstance(); 59 } 60 return pLogger; 61 } 62 63 64 /** 39 65 * Changes the logger group settings. 40 66 * … … 42 68 * @param pVM The VM handle. 43 69 * @param pszGroupSettings The group settings string. (VBOX_LOG) 70 * By prefixing the string with \"release:\" the 71 * changes will be applied to the release log 72 * instead of the debug log. The prefix \"debug:\" 73 * is also recognized. 44 74 */ 45 75 VMMR3DECL(int) DBGFR3LogModifyGroups(PVM pVM, const char *pszGroupSettings) … … 61 91 static DECLCALLBACK(int) dbgfR3LogModifyGroups(PVM pVM, const char *pszGroupSettings) 62 92 { 63 int rc = RTLogGroupSettings(NULL, pszGroupSettings); 93 PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszGroupSettings); 94 if (!pLogger) 95 return VINF_SUCCESS; 96 97 int rc = RTLogGroupSettings(pLogger, pszGroupSettings); 64 98 if (RT_SUCCESS(rc)) 65 99 rc = VMMR3UpdateLoggers(pVM); … … 74 108 * @param pVM The VM handle. 75 109 * @param pszFlagSettings The group settings string. (VBOX_LOG_FLAGS) 110 * By prefixing the string with \"release:\" the 111 * changes will be applied to the release log 112 * instead of the debug log. The prefix \"debug:\" 113 * is also recognized. 76 114 */ 77 115 VMMR3DECL(int) DBGFR3LogModifyFlags(PVM pVM, const char *pszFlagSettings) … … 93 131 static DECLCALLBACK(int) dbgfR3LogModifyFlags(PVM pVM, const char *pszFlagSettings) 94 132 { 95 int rc = RTLogFlags(NULL, pszFlagSettings); 133 PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszFlagSettings); 134 if (!pLogger) 135 return VINF_SUCCESS; 136 137 int rc = RTLogFlags(pLogger, pszFlagSettings); 96 138 if (RT_SUCCESS(rc)) 97 139 rc = VMMR3UpdateLoggers(pVM); … … 106 148 * @param pVM The VM handle. 107 149 * @param pszDestSettings The destination settings string. (VBOX_LOG_DEST) 150 * By prefixing the string with \"release:\" the 151 * changes will be applied to the release log 152 * instead of the debug log. The prefix \"debug:\" 153 * is also recognized. 108 154 */ 109 155 VMMR3DECL(int) DBGFR3LogModifyDestinations(PVM pVM, const char *pszDestSettings) … … 125 171 static DECLCALLBACK(int) dbgfR3LogModifyDestinations(PVM pVM, const char *pszDestSettings) 126 172 { 173 PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszDestSettings); 174 if (!pLogger) 175 return VINF_SUCCESS; 176 127 177 int rc = RTLogDestinations(NULL, pszDestSettings); 128 178 if (RT_SUCCESS(rc))
Note:
See TracChangeset
for help on using the changeset viewer.