Skip to content

Commit ee2b916

Browse files
committed
fix(config): fix configuration insertion
1 parent 3d3cf14 commit ee2b916

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

Agent/OCSInventory.cpp

+9-10
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,6 @@ BOOL COCSInventoryApp::InitInstance()
129129
// Agent Configuration
130130
m_pConfig = getAgentConfig();
131131

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-
141132
// Communication provider loader
142133
CComProvider *pProvider = getComServerProvider();
143134
CServerConfig *pServerConfig = NULL;
@@ -167,9 +158,17 @@ BOOL COCSInventoryApp::InitInstance()
167158
* Parse command line
168159
*
169160
****/
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+
170169
if (!bParseCommandLine)
171170
{
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);
173172
m_nExitCode = OCS_APP_GENERIC_ERROR;
174173
goto CLEAN_AND_EXIT;
175174
}

0 commit comments

Comments
 (0)