Skip to content
Snippets Groups Projects
Commit 3a1c759c authored by Julien Bonjean's avatar Julien Bonjean
Browse files

[#2531] Removed log4c

+ This library is not supported anymore

Conflicts:

	sflphone-client-gnome/src/Makefile.am
parent 2318922f
No related branches found
No related tags found
No related merge requests found
...@@ -6,16 +6,13 @@ GCONFTOOL=gconftool-2 ...@@ -6,16 +6,13 @@ GCONFTOOL=gconftool-2
GNOME_DOC=gnome-doc-utils.make GNOME_DOC=gnome-doc-utils.make
log4crc_DATA = log4crc
log4crcdir = $(datadir)/sflphone
uidir=$(datadir)/sflphone/ui uidir=$(datadir)/sflphone/ui
ui_DATA=src/ui.xml ui_DATA=src/ui.xml
schemadir = @GCONF_SCHEMA_FILE_DIR@ schemadir = @GCONF_SCHEMA_FILE_DIR@
schema_DATA = sflphone-client-gnome.schemas schema_DATA = sflphone-client-gnome.schemas
EXTRA_DIST = $(log4crc_DATA) sflphone.desktop.in $(GNOME_DOC) m4 $(UI_DATA) $(schema_DATA) EXTRA_DIST = sflphone.desktop.in $(GNOME_DOC) m4 $(UI_DATA) $(schema_DATA)
appsdir = $(datadir)/applications appsdir = $(datadir)/applications
apps_in_files = sflphone.desktop.in apps_in_files = sflphone.desktop.in
apps_DATA = $(apps_in_files:.desktop.in=.desktop) apps_DATA = $(apps_in_files:.desktop.in=.desktop)
......
...@@ -35,12 +35,6 @@ AC_PROG_LIBTOOL ...@@ -35,12 +35,6 @@ AC_PROG_LIBTOOL
dnl GCONF utilities dnl GCONF utilities
AM_GCONF_SOURCE_2 AM_GCONF_SOURCE_2
dnl Check for log4c
AC_CHECK_HEADERS(log4c.h, have_log4c=true, have_log4c=false)
if ! $have_log4c; then
AC_MSG_ERROR(Please install the log4c library)
fi
dnl uninstalled gsr ui dir dnl uninstalled gsr ui dir
AC_DEFINE_UNQUOTED(SFLPHONE_UIDIR_UNINSTALLED, "`pwd`/src/", AC_DEFINE_UNQUOTED(SFLPHONE_UIDIR_UNINSTALLED, "`pwd`/src/",
[path to uninstalled SFLphone UI dir]) [path to uninstalled SFLphone UI dir])
......
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE log4c SYSTEM "">
<log4c version="1.2.1">
<config>
<bufsize>0</bufsize>
<debug level="2"/>
<nocleanup>0</nocleanup>
<reread>1</reread>
</config>
<rollingpolicy name="rollingpolicy" type="sizewin" maxsize="1024" maxnum="10" />
<appender name="rollingfileappender" type="rollingfile" logdir="." prefix="prefix" layout="dated" rollingpolicy="rollingpolicy" />
<appender name="stdout" type="stream" layout="basic"/>
<appender name="stderr" type="stream" layout="dated"/>
<appender name="syslog" type="syslog" layout="basic"/>
<layout name="basic" type="basic"/>
<layout name="dated" type="dated"/>
<category name="root" priority="warning"/>
<category name="org.sflphone.gtk" priority="warning" appender="stdout" />
</log4c>
...@@ -5,7 +5,6 @@ bin_PROGRAMS = sflphone-client-gnome ...@@ -5,7 +5,6 @@ bin_PROGRAMS = sflphone-client-gnome
SUBDIRS = config contacts dbus widget icons SUBDIRS = config contacts dbus widget icons
NOFIFY_LIBS = -lnotify NOFIFY_LIBS = -lnotify
LOG4C = -llog4c
X11_LIBS = -lX11 X11_LIBS = -lX11
SFLPHONEGTK_LIBS=./contacts/libcontacts.la ./config/libconfig.la ./dbus/libdbus.la ./widget/libwidget.la ./icons/libicons.la SFLPHONEGTK_LIBS=./contacts/libcontacts.la ./config/libconfig.la ./dbus/libdbus.la ./widget/libwidget.la ./icons/libicons.la
...@@ -13,6 +12,7 @@ SFLPHONEGTK_LIBS=./contacts/libcontacts.la ./config/libconfig.la ./dbus/libdbus. ...@@ -13,6 +12,7 @@ SFLPHONEGTK_LIBS=./contacts/libcontacts.la ./config/libconfig.la ./dbus/libdbus.
sflphone_client_gnome_SOURCES = \ sflphone_client_gnome_SOURCES = \
main.c \ main.c \
errors.c \ errors.c \
logger.c \
uimanager.c \ uimanager.c \
sflnotify.c \ sflnotify.c \
mainwindow.c \ mainwindow.c \
...@@ -31,9 +31,9 @@ sflphone_client_gnome_SOURCES = \ ...@@ -31,9 +31,9 @@ sflphone_client_gnome_SOURCES = \
noinst_HEADERS = actions.h sflnotify.h mainwindow.h dialpad.h codeclist.h \ noinst_HEADERS = actions.h sflnotify.h mainwindow.h dialpad.h codeclist.h \
reqaccount.h errors.h sflphone_const.h uimanager.h \ reqaccount.h errors.h sflphone_const.h uimanager.h \
accountlist.h sliders.h statusicon.h callable_obj.h conference_obj.h \ accountlist.h sliders.h statusicon.h callable_obj.h conference_obj.h \
shortcuts.h eel-gconf-extensions.h shortcuts.h eel-gconf-extensions.h logger.h
sflphone_client_gnome_LDADD = $(DEPS_LIBS) $(NOTIFY_LIBS) $(SFLPHONEGTK_LIBS) $(LIBSEXY_LIBS) $(LOG4C) $(X11_LIBS) sflphone_client_gnome_LDADD = $(DEPS_LIBS) $(NOTIFY_LIBS) $(SFLPHONEGTK_LIBS) $(LIBSEXY_LIBS) $(X11_LIBS)
# add symbolic link # add symbolic link
install-exec-local: install-exec-local:
......
...@@ -193,7 +193,7 @@ static GPtrArray* getNewCredential (GHashTable * properties) { ...@@ -193,7 +193,7 @@ static GPtrArray* getNewCredential (GHashTable * properties) {
DEBUG("shit"); DEBUG("shit");
if(valid == FALSE) { if(valid == FALSE) {
DEBUG("Gtk tree model iter is not valid") DEBUG("Gtk tree model iter is not valid");
return NULL; return NULL;
} }
...@@ -1182,7 +1182,7 @@ GtkWidget* create_published_address (account_t **a) { ...@@ -1182,7 +1182,7 @@ GtkWidget* create_published_address (account_t **a) {
GtkWidget* create_advanced_tab (account_t **a) { GtkWidget* create_advanced_tab (account_t **a) {
// Build the advanced tab, to appear on the account configuration panel // Build the advanced tab, to appear on the account configuration panel
DEBUG("Config: Build advanced tab") DEBUG("Config: Build advanced tab");
GtkWidget *ret, *frame; GtkWidget *ret, *frame;
......
...@@ -414,7 +414,7 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gch ...@@ -414,7 +414,7 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gch
case DISPLAY_TYPE_CALL_TRANSFER: case DISPLAY_TYPE_CALL_TRANSFER:
DEBUG("CallTree: Display a call transfer") DEBUG("CallTree: Display a call transfer");
if(g_strcmp0("",c->_peer_name) == 0){ if(g_strcmp0("",c->_peer_name) == 0){
description = g_markup_printf_escaped("<b>%s</b><i>%s</i>\n<i>Transfert to:%s</i> ", description = g_markup_printf_escaped("<b>%s</b><i>%s</i>\n<i>Transfert to:%s</i> ",
...@@ -902,7 +902,7 @@ void calltree_add_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) ...@@ -902,7 +902,7 @@ void calltree_add_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent)
} }
} }
DEBUG("Added call key exchange is %s", key_exchange) DEBUG("Added call key exchange is %s", key_exchange);
if( tab == current_calls ) if( tab == current_calls )
{ {
......
/*
* Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc.
* Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#include <logger.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
int log_level = LOG_INFO;
void internal_log(const int level, const char* format, ...)
{
if(level > log_level)
return;
printf("%d\n",level);
printf("%d\n",log_level);
va_list ap;
char *prefix = "<> ";
char buffer[4000];
char message[4096];
switch(level)
{
case LOG_ERR:
{
prefix = "<error> ";
break;
}
case LOG_WARN:
{
prefix = "<warning> ";
break;
}
case LOG_INFO:
{
prefix = "<info> ";
break;
}
case LOG_DEBUG:
{
prefix = "<debug> ";
break;
}
}
va_start(ap, format);
vsprintf(buffer, format, ap);
va_end(ap);
message[0] = '\0';
strncat(message, prefix, strlen(prefix));
strncat(message, buffer, strlen(buffer));
strncat(message, "\n", 1);
fprintf(stderr, "%s", message);
}
void set_log_level(const int level)
{
log_level = level;
}
/*
* Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc.
* Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef __LOGGER_H
#define __LOGGER_H
void internal_log(const int level, const char* format, ...);
void set_log_level(const int level);
#define LOG_ERR 1
#define LOG_WARN 2
#define LOG_INFO 3
#define LOG_DEBUG 4
#define ERROR(...) internal_log(LOG_ERR, __VA_ARGS__)
#define WARN(...) internal_log(LOG_WARN, __VA_ARGS__)
#define INFO(...) internal_log(LOG_INFO, __VA_ARGS__)
#define DEBUG(...) internal_log(LOG_DEBUG, __VA_ARGS__)
#endif
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <actions.h> #include <actions.h>
#include <calllist.h> #include <calllist.h>
#include <config.h> #include <config.h>
#include <logger.h>
#include <dbus/dbus.h> #include <dbus/dbus.h>
#include <mainwindow.h> #include <mainwindow.h>
#include <statusicon.h> #include <statusicon.h>
...@@ -42,44 +43,16 @@ ...@@ -42,44 +43,16 @@
#include "shortcuts.h" #include "shortcuts.h"
/**
* Stop logging engine
*/
static void
shutdown_logging ()
{
if (log4c_fini ())
{
ERROR("log4c_fini() failed");
}
}
/**
* Start loggin engine
*/
static void
startup_logging ()
{
log4c_init ();
if (log4c_load (DATA_DIR "/log4crc") == -1)
g_warning ("Cannot load log4j configuration file : %s", DATA_DIR "/log4crc");
log4c_sfl_gtk_category = log4c_category_get ("org.sflphone.gtk");
}
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
// Handle logging // Handle logging
int i; int i;
// Startup logging
startup_logging ();
// Check arguments if debug mode is activated // Check arguments if debug mode is activated
for (i = 0; i < argc; i++) for (i = 0; i < argc; i++)
if (g_strcmp0 (argv[i], "--debug") == 0) if (g_strcmp0 (argv[i], "--debug") == 0)
log4c_category_set_priority (log4c_sfl_gtk_category, LOG4C_PRIORITY_DEBUG); set_log_level (LOG_DEBUG);
// Start GTK application // Start GTK application
...@@ -100,8 +73,6 @@ main (int argc, char *argv[]) ...@@ -100,8 +73,6 @@ main (int argc, char *argv[])
"shall include the source code for the parts of OpenSSL used as well\n" \ "shall include the source code for the parts of OpenSSL used as well\n" \
"as that of the covered work.\n\n"); "as that of the covered work.\n\n");
DEBUG("Logging Started");
srand (time (NULL)); srand (time (NULL));
// Internationalization // Internationalization
...@@ -146,9 +117,6 @@ main (int argc, char *argv[]) ...@@ -146,9 +117,6 @@ main (int argc, char *argv[])
gtk_main (); gtk_main ();
} }
// Cleanly stop logging
shutdown_logging ();
shortcuts_destroy_bindings(); shortcuts_destroy_bindings();
return 0; return 0;
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
#define __SFLPHONE_CONST_H #define __SFLPHONE_CONST_H
#include <libintl.h> #include <libintl.h>
#include "logger.h"
#include "dbus.h" #include "dbus.h"
#include "log4c.h"
/* @file sflphone_const.h /* @file sflphone_const.h
* @brief Contains the global variables for the client code * @brief Contains the global variables for the client code
...@@ -117,11 +117,6 @@ ...@@ -117,11 +117,6 @@
#define REGISTRATION_STATE_CODE "Registration.code" #define REGISTRATION_STATE_CODE "Registration.code"
#define REGISTRATION_STATE_DESCRIPTION "Registration.description" #define REGISTRATION_STATE_DESCRIPTION "Registration.description"
/**
* Global logger
*/
log4c_category_t* log4c_sfl_gtk_category;
/** Error while opening capture device */ /** Error while opening capture device */
#define ALSA_CAPTURE_DEVICE 0x0001 #define ALSA_CAPTURE_DEVICE 0x0001
/** Error while opening playback device */ /** Error while opening playback device */
...@@ -169,14 +164,6 @@ log4c_category_t* log4c_sfl_gtk_category; ...@@ -169,14 +164,6 @@ log4c_category_t* log4c_sfl_gtk_category;
/** Desktop notifications - Time before to close the notification*/ /** Desktop notifications - Time before to close the notification*/
#define __TIMEOUT_TIME 18000 // 30 secondes #define __TIMEOUT_TIME 18000 // 30 secondes
/**
* Macros for logging
*/
#define DEBUG(...) log4c_category_log(log4c_sfl_gtk_category, LOG4C_PRIORITY_DEBUG, __VA_ARGS__);
#define WARN(...) log4c_category_log(log4c_sfl_gtk_category, LOG4C_PRIORITY_WARN, __VA_ARGS__);
#define ERROR(...) log4c_category_log(log4c_sfl_gtk_category, LOG4C_PRIORITY_ERROR, __VA_ARGS__);
#define FATAL(...) log4c_category_log(log4c_sfl_gtk_category, LOG4C_PRIORITY_FATAL, __VA_ARGS__);
/** /**
* Gconf * Gconf
*/ */
......
...@@ -27,24 +27,24 @@ SFLPHONE_OBJ = $(top_builddir)/src/accountlist.o \ ...@@ -27,24 +27,24 @@ SFLPHONE_OBJ = $(top_builddir)/src/accountlist.o \
check_global_SOURCES = check_global.c check_global_SOURCES = check_global.c
check_global_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@ check_global_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@
check_global_LDADD = $(SFLPHONE_LIBS) $(SFLPHONE_OBJ) @CHECK_LIBS@ $(DEPS_LIBS) @LIBSEXY_LIBS@ -llog4c check_global_LDADD = $(SFLPHONE_LIBS) $(SFLPHONE_OBJ) @CHECK_LIBS@ $(DEPS_LIBS) @LIBSEXY_LIBS@
########################################################### ###########################################################
check_contacts_SOURCES = check_contacts.c check_contacts_SOURCES = check_contacts.c
check_contacts_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@ check_contacts_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@
check_contacts_LDADD = $(SFLPHONE_LIBS) $(SFLPHONE_OBJ) @CHECK_LIBS@ $(DEPS_LIBS) @LIBSEXY_LIBS@ -llog4c check_contacts_LDADD = $(SFLPHONE_LIBS) $(SFLPHONE_OBJ) @CHECK_LIBS@ $(DEPS_LIBS) @LIBSEXY_LIBS@
########################################################### ###########################################################
check_config_SOURCES = check_config.c check_config_SOURCES = check_config.c
check_config_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@ check_config_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@
check_config_LDADD = $(SFLPHONE_LIBS) $(SFLPHONE_OBJ) @CHECK_LIBS@ @DEPS_LIBS@ @LIBSEXY_LIBS@ -llog4c check_config_LDADD = $(SFLPHONE_LIBS) $(SFLPHONE_OBJ) @CHECK_LIBS@ @DEPS_LIBS@ @LIBSEXY_LIBS@
########################################################### ###########################################################
check_dbus_SOURCES = check_dbus.c check_dbus_SOURCES = check_dbus.c
check_dbus_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@ check_dbus_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@
check_dbus_LDADD = $(SFLPHONE_LIBS) $(SFLPHONE_OBJ) @CHECK_LIBS@ @DEPS_LIBS@ @LIBSEXY_LIBS@ -llog4c check_dbus_LDADD = $(SFLPHONE_LIBS) $(SFLPHONE_OBJ) @CHECK_LIBS@ @DEPS_LIBS@ @LIBSEXY_LIBS@
########################################################### ###########################################################
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment