@@ -129,15 +129,6 @@ BOOL COCSInventoryApp::InitInstance()
129
129
// Agent Configuration
130
130
m_pConfig = getAgentConfig ();
131
131
132
- // Parse command line before instanciate logger
133
- BOOL bParseCommandLine = parseCommandLine ();
134
-
135
- // Logger
136
- m_pLogger = getOcsLogger ();
137
- m_pLogger->setApplication ( AfxGetAppName ());
138
- m_pLogger->log ( LOG_PRIORITY_NOTICE, _T ( " ==============================================================================" ));
139
- m_pLogger->log ( LOG_PRIORITY_NOTICE, _T ( " Starting OCS Inventory Agent on %s." ), cStartTime.Format ( _T ( " %#c" )));
140
-
141
132
// Communication provider loader
142
133
CComProvider *pProvider = getComServerProvider ();
143
134
CServerConfig *pServerConfig = NULL ;
@@ -167,9 +158,17 @@ BOOL COCSInventoryApp::InitInstance()
167
158
* Parse command line
168
159
*
169
160
****/
161
+ BOOL bParseCommandLine = parseCommandLine ();
162
+
163
+ // Logger
164
+ m_pLogger = getOcsLogger ();
165
+ m_pLogger->setApplication (AfxGetAppName ());
166
+ m_pLogger->log (LOG_PRIORITY_NOTICE, _T (" ==============================================================================" ));
167
+ m_pLogger->log (LOG_PRIORITY_NOTICE, _T (" Starting OCS Inventory Agent on %s." ), cStartTime.Format (_T (" %#c" )));
168
+
170
169
if (!bParseCommandLine)
171
170
{
172
- m_pLogger->log (LOG_PRIORITY_ERROR, _T ( " AGENT => Failed initializing using provided command line parameters <%s>" ), m_lpCmdLine);
171
+ m_pLogger->log (LOG_PRIORITY_ERROR, _T (" AGENT => Failed initializing using provided command line parameters <%s>" ), m_lpCmdLine);
173
172
m_nExitCode = OCS_APP_GENERIC_ERROR;
174
173
goto CLEAN_AND_EXIT;
175
174
}
0 commit comments