Skip to content

Commit 0d18053

Browse files
committed
API - add additional log output
1 parent 6bf4184 commit 0d18053

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

app/api/src/sonicpi_api.cpp

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,35 @@ SonicPiAPI::~SonicPiAPI()
302302

303303
void SonicPiAPI::Shutdown()
304304
{
305+
LOG(INFO, "Shutdown");
306+
307+
switch(m_state)
308+
{
309+
case State::Reset :
310+
LOG(INFO, "Shutting down with state: Reset");
311+
break;
312+
case State::Initializing :
313+
LOG(INFO, "Shutting down with state: Initializing");
314+
break;
315+
case State::Invalid :
316+
LOG(INFO, "Shutting down with state: Invalid");
317+
break;
318+
case State::Created :
319+
LOG(INFO, "Shutting down with state: Created");
320+
break;
321+
case State::Error :
322+
LOG(INFO, "Shutting down with state: Error");
323+
break;
324+
default :
325+
LOG(INFO, "Shutting down with unknown state!! Warning!");
326+
}
327+
305328
if (m_state == State::Created || m_state == State::Invalid || m_state == State::Initializing)
306329
{
307-
LOG(INFO, "Shutdown");
308-
330+
LOG(INFO, "Resetting audio processor...");
309331
m_spAudioProcessor.reset();
310332

333+
LOG(INFO, "Stopping OSC server...");
311334
StopOscServer();
312335

313336
if (m_coutbuf)
@@ -319,7 +342,7 @@ void SonicPiAPI::Shutdown()
319342

320343
if (m_bootDaemonSock)
321344
{
322-
LOG(INFO, "Closing socket to Boot Daemon...");
345+
LOG(INFO, "Closing socket to Boot Daemon...");
323346
m_bootDaemonSock->close();
324347
} else {
325348
LOG(INFO, "Boot Daemon socket not found so no need to close...");
@@ -400,13 +423,16 @@ bool SonicPiAPI::WaitUntilReady()
400423

401424
bool SonicPiAPI::PingUntilServerCreated()
402425
{
426+
LOG(INFO, "Pinging Spider Server until a response is received...");
403427
if (m_state == State::Created)
404428
{
405429
return true;
430+
LOG(ERR, "Error! No need to ping server as it's already created!");
406431
}
407432

408433
if (m_state != State::Initializing)
409434
{
435+
LOG(ERR, "API is not in the initialisation state. Error!");
410436
return false;
411437
}
412438

0 commit comments

Comments
 (0)