From 360b1223d4e90f73e39c6e0ed45a8981cddb3c76 Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Mon, 28 Nov 2016 19:37:31 +0100 Subject: [PATCH] Add some logging --- bin/php-language-server.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/php-language-server.php b/bin/php-language-server.php index 92633d7..7cb3178 100644 --- a/bin/php-language-server.php +++ b/bin/php-language-server.php @@ -52,17 +52,19 @@ if (!empty($options['tcp'])) { fwrite(STDERR, "Could not listen on $address. Error $errno\n$errstr"); exit(1); } + fwrite(STDOUT, "Server listening on $address\n"); if (!extension_loaded('pcntl')) { - fwrite(STDERR, 'PCNTL is not available. Only a single connection will be accepted'); + fwrite(STDERR, "PCNTL is not available. Only a single connection will be accepted\n"); } while ($socket = stream_socket_accept($tcpServer, -1)) { + fwrite(STDOUT, "Connection accepted\n"); stream_set_blocking($socket, false); if (extension_loaded('pcntl')) { // If PCNTL is available, fork a child process for the connection // An exit notification will only terminate the child process $pid = pcntl_fork(); if ($pid === -1) { - fwrite(STDERR, 'Could not fork'); + fwrite(STDERR, "Could not fork\n"); exit(1); } else if ($pid === 0) { // Child process