X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/b6f9db38b4be65b8893ae726a6d78e7ac657dc35..f91192c77eec33a27dea7fcd0d451823ef478529:/projects/stargazer/plugins/other/smux/smux.cpp diff --git a/projects/stargazer/plugins/other/smux/smux.cpp b/projects/stargazer/plugins/other/smux/smux.cpp index 551a28f1..bef6e462 100644 --- a/projects/stargazer/plugins/other/smux/smux.cpp +++ b/projects/stargazer/plugins/other/smux/smux.cpp @@ -111,7 +111,8 @@ SMUX::SMUX() notifiers(), addUserNotifier(*this), delUserNotifier(*this), - addDelTariffNotifier(*this) + addDelTariffNotifier(*this), + logger(GetPluginLogger(GetStgLogger(), "smux")) { pthread_mutex_init(&mutex, NULL); @@ -204,6 +205,7 @@ if (!running) if (pthread_create(&thread, NULL, Runner, this)) { errorStr = "Cannot create thread."; + logger("Cannot create thread."); printfd(__FILE__, "Cannot create thread\n"); return -1; } @@ -315,6 +317,7 @@ sock = socket(AF_INET, SOCK_STREAM, 0); if (sock < 0) { errorStr = "Cannot create socket."; + logger("Cannot create a socket: %s", strerror(errno)); printfd(__FILE__, "Cannot create socket\n"); return true; } @@ -328,6 +331,7 @@ addr.sin_addr.s_addr = smuxSettings.GetIP(); if (connect(sock, reinterpret_cast(&addr), sizeof(addr))) { errorStr = "Cannot connect."; + logger("Cannot connect the socket: %s", strerror(errno)); printfd(__FILE__, "Cannot connect. Message: '%s'\n", strerror(errno)); return true; }