Changeset 37666 in vbox for trunk/src/VBox/Main/src-server/xpcom
- Timestamp:
- Jun 28, 2011 12:33:34 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 72522
- Location:
- trunk/src/VBox/Main/src-server/xpcom
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/xpcom/server.cpp
r37356 r37666 43 43 #include <iprt/getopt.h> 44 44 #include <iprt/message.h> 45 #include <iprt/string.h> 45 46 #include <iprt/stream.h> 46 47 #include <iprt/path.h> … … 792 793 static const RTGETOPTDEF s_aOptions[] = 793 794 { 794 { "--automate", 'a', RTGETOPT_REQ_NOTHING }, 795 { "--auto-shutdown", 'A', RTGETOPT_REQ_NOTHING }, 796 { "--daemonize", 'd', RTGETOPT_REQ_NOTHING }, 797 { "--pidfile", 'p', RTGETOPT_REQ_STRING }, 795 { "--automate", 'a', RTGETOPT_REQ_NOTHING }, 796 { "--auto-shutdown", 'A', RTGETOPT_REQ_NOTHING }, 797 { "--daemonize", 'd', RTGETOPT_REQ_NOTHING }, 798 { "--pidfile", 'p', RTGETOPT_REQ_STRING }, 799 { "--logfile", 'F', RTGETOPT_REQ_STRING }, 800 { "--logrotate", 'R', RTGETOPT_REQ_UINT32 }, 801 { "--logsize", 'S', RTGETOPT_REQ_UINT64 }, 802 { "--loginterval", 'I', RTGETOPT_REQ_UINT32 } 798 803 }; 799 804 805 const char *pszLogFile = NULL; 806 uint32_t cHistory = 10; // enable log rotation, 10 files 807 uint32_t uHistoryFileTime = RT_SEC_1DAY; // max 1 day per file 808 uint64_t uHistoryFileSize = 100 * _1M; // max 100MB per file 800 809 bool fDaemonize = false; 801 810 PRFileDesc *daemon_pipe_wr = nsnull; … … 839 848 } 840 849 850 case 'F': 851 pszLogFile = ValueUnion.psz; 852 break; 853 854 case 'R': 855 cHistory = ValueUnion.u32; 856 break; 857 858 case 'S': 859 uHistoryFileSize = ValueUnion.u64; 860 break; 861 862 case 'I': 863 uHistoryFileTime = ValueUnion.u32; 864 break; 865 841 866 case 'h': 842 867 { … … 862 887 } 863 888 864 nsresult rc; 889 nsresult rc; 890 891 if (!pszLogFile) 892 { 893 char szLogFile[RTPATH_MAX]; 894 vrc = com::GetVBoxUserHomeDirectory(szLogFile, sizeof(szLogFile)); 895 if (RT_SUCCESS(vrc)) 896 vrc = RTPathAppend(szLogFile, sizeof(szLogFile), "VBoxSVC.log"); 897 if (RT_SUCCESS(vrc)) 898 pszLogFile = RTStrDup(szLogFile); 899 } 900 VBoxSVCLogRelCreate(pszLogFile, cHistory, uHistoryFileTime, uHistoryFileSize); 865 901 866 902 daemon_pipe_wr = PR_GetInheritedFD(VBOXSVC_STARTUP_PIPE_NAME); -
trunk/src/VBox/Main/src-server/xpcom/server_module.cpp
r37010 r37666 49 49 #include <VBox/err.h> 50 50 51 #include <iprt/assert.h> 51 52 #include <iprt/param.h> 52 53 #include <iprt/path.h>
Note:
See TracChangeset
for help on using the changeset viewer.