Changeset 93747 in vbox for trunk/src/VBox/ValidationKit/utils
- Timestamp:
- Feb 15, 2022 8:33:16 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/TestExecServ/TestExecService.cpp
r93732 r93747 3034 3034 static RTEXITCODE txsMainLoop(void) 3035 3035 { 3036 RTMsgInfo("Version %s r%s %s.%s (%s %s)\n",3037 RTBldCfgVersion(), RTBldCfgRevisionStr(), KBUILD_TARGET, KBUILD_TARGET_ARCH, __DATE__, __TIME__);3038 3039 3036 if (g_cVerbose > 0) 3040 3037 RTMsgInfo("txsMainLoop: start...\n"); … … 3784 3781 } 3785 3782 3783 /** 3784 * @callback_method_impl{FNRTLOGPHASE, Release logger callback} 3785 */ 3786 static DECLCALLBACK(void) logHeaderFooter(PRTLOGGER pLoggerRelease, RTLOGPHASE enmPhase, PFNRTLOGPHASEMSG pfnLog) 3787 { 3788 /* Some introductory information. */ 3789 static RTTIMESPEC s_TimeSpec; 3790 char szTmp[256]; 3791 if (enmPhase == RTLOGPHASE_BEGIN) 3792 RTTimeNow(&s_TimeSpec); 3793 RTTimeSpecToString(&s_TimeSpec, szTmp, sizeof(szTmp)); 3794 3795 switch (enmPhase) 3796 { 3797 case RTLOGPHASE_BEGIN: 3798 { 3799 pfnLog(pLoggerRelease, 3800 "TestExecService (Validation Kit TxS) %s r%s (verbosity: %u) %s %s (%s %s) release log\n" 3801 "(C) " VBOX_C_YEAR " " VBOX_VENDOR "\n" 3802 "All rights reserved.\n\n" 3803 "Log opened %s\n", 3804 RTBldCfgVersion(), RTBldCfgRevisionStr(), g_cVerbose, 3805 KBUILD_TARGET, KBUILD_TARGET_ARCH, 3806 __DATE__, __TIME__, szTmp); 3807 3808 int vrc = RTSystemQueryOSInfo(RTSYSOSINFO_PRODUCT, szTmp, sizeof(szTmp)); 3809 if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW) 3810 pfnLog(pLoggerRelease, "OS Product: %s\n", szTmp); 3811 vrc = RTSystemQueryOSInfo(RTSYSOSINFO_RELEASE, szTmp, sizeof(szTmp)); 3812 if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW) 3813 pfnLog(pLoggerRelease, "OS Release: %s\n", szTmp); 3814 vrc = RTSystemQueryOSInfo(RTSYSOSINFO_VERSION, szTmp, sizeof(szTmp)); 3815 if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW) 3816 pfnLog(pLoggerRelease, "OS Version: %s\n", szTmp); 3817 vrc = RTSystemQueryOSInfo(RTSYSOSINFO_SERVICE_PACK, szTmp, sizeof(szTmp)); 3818 if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW) 3819 pfnLog(pLoggerRelease, "OS Service Pack: %s\n", szTmp); 3820 3821 /* the package type is interesting for Linux distributions */ 3822 char szExecName[RTPATH_MAX]; 3823 char *pszExecName = RTProcGetExecutablePath(szExecName, sizeof(szExecName)); 3824 pfnLog(pLoggerRelease, 3825 "Executable: %s\n" 3826 "Process ID: %u\n" 3827 "Package type: %s" 3828 #ifdef VBOX_OSE 3829 " (OSE)" 3830 #endif 3831 "\n", 3832 pszExecName ? pszExecName : "unknown", 3833 RTProcSelf(), 3834 VBOX_PACKAGE_STRING); 3835 break; 3836 } 3837 3838 case RTLOGPHASE_PREROTATE: 3839 pfnLog(pLoggerRelease, "Log rotated - Log started %s\n", szTmp); 3840 break; 3841 3842 case RTLOGPHASE_POSTROTATE: 3843 pfnLog(pLoggerRelease, "Log continuation - Log started %s\n", szTmp); 3844 break; 3845 3846 case RTLOGPHASE_END: 3847 pfnLog(pLoggerRelease, "End of log file - Log started %s\n", szTmp); 3848 break; 3849 3850 default: 3851 /* nothing */ 3852 break; 3853 } 3854 } 3786 3855 3787 3856 int main(int argc, char **argv) … … 3828 3897 fFlags |= RTLOGFLAGS_USECRLF; 3829 3898 #endif 3830 static const char * const g_apszLogGroups[] = VBOX_LOGGROUP_NAMES; 3831 rc = RTLogCreate(&g_pRelLogger, fFlags, "all.e.l", "VBOX_TXS_RELEASE_LOG", 3832 RT_ELEMENTS(g_apszLogGroups), g_apszLogGroups, RTLOGDEST_STDOUT | RTLOGDEST_FILE, szLogFile); 3899 static const char * const s_apszLogGroups[] = VBOX_LOGGROUP_NAMES; 3900 rc = RTLogCreateEx(&g_pRelLogger, "VBOX_TXS_RELEASE_LOG", fFlags, "all", 3901 RT_ELEMENTS(s_apszLogGroups), s_apszLogGroups, UINT32_MAX /* cMaxEntriesPerGroup */, 3902 0 /*cBufDescs*/, NULL /* paBufDescs */, RTLOGDEST_STDOUT | RTLOGDEST_FILE, 3903 logHeaderFooter /* pfnPhase */ , 3904 10 /* cHistory */, 100 * _1M /* cbHistoryFileMax */, RT_SEC_1DAY /* cSecsHistoryTimeSlot */, 3905 NULL /* pErrInfo */, "%s", szLogFile); 3833 3906 if (RT_SUCCESS(rc)) 3834 3907 { … … 3866 3939 if (RT_SUCCESS(rc)) 3867 3940 RTMsgInfo("Log file written to '%s'\n", szLogFile); 3868 3869 LogRel((VBOX_PRODUCT " TestExecService (Validation Kit TxS) Version " VBOX_VERSION_STRING " - r%s\n"3870 "(C) " VBOX_C_YEAR " " VBOX_VENDOR "\n"3871 "All rights reserved.\n\n", RTBldCfgRevisionStr()));3872 3941 } 3873 3942
Note:
See TracChangeset
for help on using the changeset viewer.