Logging changes, no functional changes

This commit is contained in:
Deon George 2023-07-19 10:35:29 +10:00
parent dcae06aad9
commit 3d4431da9a
1 changed files with 6 additions and 6 deletions

View File

@ -70,7 +70,7 @@ class ServerStart extends Command
Log::debug(sprintf('%s:# Servers [%d]',self::LOGKEY,$start->count())); Log::debug(sprintf('%s:# Servers [%d]',self::LOGKEY,$start->count()));
if (! $start->count()) { if (! $start->count()) {
Log::alert(sprintf('%s:- No servers configured to start',self::LOGKEY)); Log::alert(sprintf('%s:! No servers configured to start',self::LOGKEY));
return; return;
} }
@ -78,7 +78,7 @@ class ServerStart extends Command
pcntl_signal(SIGCHLD,SIG_IGN); pcntl_signal(SIGCHLD,SIG_IGN);
foreach ($start as $item => $config) { foreach ($start as $item => $config) {
Log::debug(sprintf('%s: - Starting [%s] (%d)',self::LOGKEY,$item,getmypid())); Log::debug(sprintf('%s:- Starting [%s] (%d)',self::LOGKEY,$item,getmypid()));
$pid = pcntl_fork(); $pid = pcntl_fork();
@ -88,7 +88,7 @@ class ServerStart extends Command
// We are the child // We are the child
if (! $pid) { if (! $pid) {
Log::withContext(['pid'=>getmypid()]); Log::withContext(['pid'=>getmypid()]);
Log::info(sprintf('%s: - Started [%s]',self::LOGKEY,$item)); Log::info(sprintf('%s:= Started [%s]',self::LOGKEY,$item));
$server = new SocketServer($config['port'],$config['address'],$config['proto']); $server = new SocketServer($config['port'],$config['address'],$config['proto']);
$server->handler = [$config['class'],'onConnect']; $server->handler = [$config['class'],'onConnect'];
@ -103,13 +103,13 @@ class ServerStart extends Command
Log::emergency(sprintf('%s:! Uncaught Message: %s',self::LOGKEY,$e->getMessage())); Log::emergency(sprintf('%s:! Uncaught Message: %s',self::LOGKEY,$e->getMessage()));
} }
Log::info(sprintf('%s: - Finished: [%s]',self::LOGKEY,$item)); Log::info(sprintf('%s:= Finished: [%s]',self::LOGKEY,$item));
// Child finished we need to get out of this loop. // Child finished we need to get out of this loop.
exit; exit;
} }
Log::info(sprintf('%s: - Forked for [%s] (%d)',self::LOGKEY,$item,$pid)); Log::debug(sprintf('%s:- Forked for [%s] (%d)',self::LOGKEY,$item,$pid));
$children->put($pid,$item); $children->put($pid,$item);
} }
@ -121,7 +121,7 @@ class ServerStart extends Command
if ($exited < 0) if ($exited < 0)
abort(500,'Something strange for status: '.serialize($status)); abort(500,'Something strange for status: '.serialize($status));
Log::info(sprintf('%s: - Exited: #%d [%s]',self::LOGKEY,$x,$children->pull($exited))); Log::info(sprintf('%s:= Exited: #%d [%s]',self::LOGKEY,$x,$children->pull($exited)));
} }
// Done // Done