Unifying logging in chanserv

This commit adds:
* replace multiple logging macros with LOG and LOG_DEVEL
* logging configuration for chanserv
* logging configuration for console output
* logging configuration for per file or method log level filtering for
debug builds
* file, line, and method name in log message for debug builds
This commit is contained in:
Alexandre Quesnel
2020-10-08 01:55:08 +00:00
parent 19504da100
commit a9ec1ebd99
40 changed files with 1542 additions and 1667 deletions
+4 -4
View File
@@ -133,18 +133,18 @@ int main(int argc, char **argv)
sock = g_tcp_socket();
if (sock < 0)
{
LOG_DBG("Socket open error, g_tcp_socket() failed");
LOG_DEVEL(LOG_LEVEL_DEBUG, "Socket open error, g_tcp_socket() failed");
return 1;
}
s = scp_session_create();
c = scp_connection_create(sock);
LOG_DBG("Connecting to %s:%s with user %s (%s)", serv, port, user, pass);
LOG_DEVEL(LOG_LEVEL_DEBUG, "Connecting to %s:%s with user %s (%s)", serv, port, user, pass);
if (0 != g_tcp_connect(sock, serv, port))
{
LOG_DBG("g_tcp_connect() error");
LOG_DEVEL(LOG_LEVEL_DEBUG, "g_tcp_connect() error");
return 1;
}
@@ -157,7 +157,7 @@ int main(int argc, char **argv)
if (SCP_CLIENT_STATE_OK != e)
{
LOG_DBG("libscp error connecting: %s %d", s->errstr, (int)e);
LOG_DEVEL(LOG_LEVEL_DEBUG, "libscp error connecting: %s %d", s->errstr, (int)e);
}
if (0 == g_strncmp(cmnd, "list", 5))