GUAC-911: Clean up logging in guacd.

This commit is contained in:
Michael Jumper 2014-11-09 22:51:40 -08:00
parent f8484c0e1e
commit 3c83f61637
2 changed files with 17 additions and 5 deletions

View File

@ -57,6 +57,9 @@ void* __guacd_client_output_thread(void* data) {
guac_client* client = (guac_client*) data; guac_client* client = (guac_client*) data;
guac_socket* socket = client->socket; guac_socket* socket = client->socket;
guac_client_log(client, GUAC_LOG_DEBUG,
"Starting output thread.");
/* Guacamole client output loop */ /* Guacamole client output loop */
while (client->state == GUAC_CLIENT_RUNNING) { while (client->state == GUAC_CLIENT_RUNNING) {
@ -106,6 +109,9 @@ void* __guacd_client_output_thread(void* data) {
} /* End of output loop */ } /* End of output loop */
guac_client_log(client, GUAC_LOG_DEBUG,
"Output thread terminated.");
guac_client_stop(client); guac_client_stop(client);
return NULL; return NULL;
@ -116,6 +122,9 @@ void* __guacd_client_input_thread(void* data) {
guac_client* client = (guac_client*) data; guac_client* client = (guac_client*) data;
guac_socket* socket = client->socket; guac_socket* socket = client->socket;
guac_client_log(client, GUAC_LOG_DEBUG,
"Starting input thread.");
/* Guacamole client input loop */ /* Guacamole client input loop */
while (client->state == GUAC_CLIENT_RUNNING) { while (client->state == GUAC_CLIENT_RUNNING) {
@ -164,6 +173,9 @@ void* __guacd_client_input_thread(void* data) {
} }
guac_client_log(client, GUAC_LOG_DEBUG,
"Input thread terminated.");
return NULL; return NULL;
} }

View File

@ -416,7 +416,7 @@ int main(int argc, char* argv[]) {
/* Allow socket reuse */ /* Allow socket reuse */
if (setsockopt(socket_fd, SOL_SOCKET, SO_REUSEADDR, if (setsockopt(socket_fd, SOL_SOCKET, SO_REUSEADDR,
(void*) &opt_on, sizeof(opt_on))) { (void*) &opt_on, sizeof(opt_on))) {
guacd_log(GUAC_LOG_INFO, "Unable to set socket options for reuse: %s", guacd_log(GUAC_LOG_WARNING, "Unable to set socket options for reuse: %s",
strerror(errno)); strerror(errno));
} }
@ -440,7 +440,7 @@ int main(int argc, char* argv[]) {
current_address->ai_addr, current_address->ai_addr,
current_address->ai_addrlen) == 0) { current_address->ai_addrlen) == 0) {
guacd_log(GUAC_LOG_INFO, "Successfully bound socket to " guacd_log(GUAC_LOG_DEBUG, "Successfully bound socket to "
"host %s, port %s", bound_address, bound_port); "host %s, port %s", bound_address, bound_port);
/* Done if successful bind */ /* Done if successful bind */
@ -450,7 +450,7 @@ int main(int argc, char* argv[]) {
/* Otherwise log information regarding bind failure */ /* Otherwise log information regarding bind failure */
else else
guacd_log(GUAC_LOG_INFO, "Unable to bind socket to " guacd_log(GUAC_LOG_DEBUG, "Unable to bind socket to "
"host %s, port %s: %s", "host %s, port %s: %s",
bound_address, bound_port, strerror(errno)); bound_address, bound_port, strerror(errno));
@ -483,7 +483,7 @@ int main(int argc, char* argv[]) {
} }
} }
else else
guacd_log(GUAC_LOG_INFO, "No PEM keyfile given - SSL/TLS may not work."); guacd_log(GUAC_LOG_WARNING, "No PEM keyfile given - SSL/TLS may not work.");
/* Load cert file if specified */ /* Load cert file if specified */
if (config->cert_file != NULL) { if (config->cert_file != NULL) {
@ -494,7 +494,7 @@ int main(int argc, char* argv[]) {
} }
} }
else else
guacd_log(GUAC_LOG_INFO, "No certificate file given - SSL/TLS may not work."); guacd_log(GUAC_LOG_WARNING, "No certificate file given - SSL/TLS may not work.");
} }
#endif #endif