Skip to content
Permalink
Browse files
[mms-engine] Logging cleanup. MER#1027
Logging functionality that used to be part of mms-engine has been
migrated to libglibutil
  • Loading branch information
monich committed Jul 13, 2016
1 parent f4d7748 commit b9fe74220019a567b1c469b0f1d033fd6cc1135f
Showing with 776 additions and 905 deletions.
  1. +1 −2 mms-connman-nemo/include/mms_connman_nemo_log.h
  2. +37 −37 mms-connman-nemo/src/mms_connection_nemo.c
  3. +14 −14 mms-connman-nemo/src/mms_connman_nemo.c
  4. +1 −2 mms-connman-ofono/include/mms_connman_ofono_log.h
  5. +27 −27 mms-connman-ofono/src/mms_connection_ofono.c
  6. +20 −20 mms-connman-ofono/src/mms_connman_ofono.c
  7. +20 −19 mms-engine/main.c
  8. +30 −31 mms-engine/mms_engine.c
  9. +19 −19 mms-handler-dbus/src/mms_handler_dbus.c
  10. +0 −4 mms-lib/Makefile
  11. +1 −2 mms-lib/include/mms_lib_log.h
  12. +0 −96 mms-lib/include/mms_log.h
  13. +12 −14 mms-lib/src/mms_attachment.c
  14. +15 −15 mms-lib/src/mms_attachment_image.c
  15. +8 −8 mms-lib/src/mms_attachment_jpeg.c
  16. +5 −5 mms-lib/src/mms_attachment_qt.cpp
  17. +6 −12 mms-lib/src/mms_codec.c
  18. +8 −7 mms-lib/src/mms_codec.h
  19. +4 −5 mms-lib/src/mms_connection.c
  20. +5 −6 mms-lib/src/mms_connman.c
  21. +26 −28 mms-lib/src/mms_dispatcher.c
  22. +3 −4 mms-lib/src/mms_error.c
  23. +3 −3 mms-lib/src/mms_error.h
  24. +6 −8 mms-lib/src/mms_file_util.c
  25. +27 −38 mms-lib/src/mms_handler.c
  26. +10 −11 mms-lib/src/mms_message.c
  27. +25 −26 mms-lib/src/mms_task.c
  28. +26 −26 mms-lib/src/mms_task_decode.c
  29. +21 −22 mms-lib/src/mms_task_encode.c
  30. +39 −39 mms-lib/src/mms_task_http.c
  31. +28 −29 mms-lib/src/mms_task_notification.c
  32. +8 −8 mms-lib/src/mms_task_publish.c
  33. +1 −3 mms-lib/src/mms_task_read.c
  34. +6 −7 mms-lib/src/mms_task_retrieve.c
  35. +8 −9 mms-lib/src/mms_task_send.c
  36. +4 −5 mms-lib/src/mms_transfer_list.c
  37. +1 −2 mms-lib/test/common/Makefile
  38. +5 −6 mms-lib/test/common/test_connection.c
  39. +5 −6 mms-lib/test/common/test_connman.c
  40. +38 −39 mms-lib/test/common/test_handler.c
  41. +6 −6 mms-lib/test/common/test_http.c
  42. +3 −4 mms-lib/test/common/test_transfer_list.c
  43. +5 −5 mms-lib/test/common/test_util.c
  44. +17 −15 mms-lib/test/test_delivery_ind/test_delivery_ind.c
  45. +7 −7 mms-lib/test/test_media_type/test_media_type.c
  46. +11 −10 mms-lib/test/test_mms_codec/test_mms_codec.c
  47. +17 −15 mms-lib/test/test_read_ind/test_read_ind.c
  48. +19 −19 mms-lib/test/test_read_report/test_read_report.c
  49. +22 −19 mms-lib/test/test_resize/test_resize.c
  50. +27 −27 mms-lib/test/test_retrieve/test_retrieve.c
  51. +19 −18 mms-lib/test/test_retrieve_cancel/test_retrieve_cancel.c
  52. +15 −16 mms-lib/test/test_retrieve_no_proxy/test_retrieve_no_proxy.c
  53. +17 −17 mms-lib/test/test_retrieve_order/test_retrieve_order.c
  54. +17 −18 mms-lib/test/test_send/test_send.c
  55. +28 −27 mms-settings-dconf/src/mms_settings_dconf.c
  56. +10 −7 mms-transfer-list-dbus/src/mms_transfer_dbus.c
  57. +12 −10 mms-transfer-list-dbus/src/mms_transfer_list_dbus.c
  58. +1 −1 rpm/mms-engine.spec
@@ -10,13 +10,12 @@
* 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.
*
*/

#ifndef JOLLA_MMS_CONNMAN_NEMO_LOG_H
#define JOLLA_MMS_CONNMAN_NEMO_LOG_H

#include "mms_log.h"
#include "mms_lib_types.h"

#define MMS_CONNMAN_LOG_MODULES(log) \
log(gofonoext_log) \
@@ -10,7 +10,6 @@
* 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.
*
*/

#include "mms_connection_nemo.h"
@@ -20,9 +19,10 @@
#include <gofono_connctx.h>

/* Logging */
#define MMS_LOG_MODULE_NAME mms_connection_log
#define GLOG_MODULE_NAME mms_connection_log
#include "mms_connman_nemo_log.h"
MMS_LOG_MODULE_DEFINE("mms-connection-nemo");
#include <gutil_log.h>
GLOG_MODULE_DEFINE("mms-connection-nemo");

enum mm_handler_id {
MM_HANDLER_VALID,
@@ -113,7 +113,7 @@ mms_connection_nemo_reset_mms_imsi_done(
void* arg)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_DEBUG("Released %s", self->path);
GDEBUG("Released %s", self->path);
mms_connman_busy_dec(self->cm);
mms_connection_unref(&self->connection);
}
@@ -161,7 +161,7 @@ mms_connection_nemo_cancel(
{
if (self->connection.state <= MMS_CONNECTION_STATE_OPENING &&
mms_connection_nemo_set_state(self, MMS_CONNECTION_STATE_FAILED)) {
MMS_DEBUG("Connection %s cancelled", self->connection.imsi);
GDEBUG("Connection %s cancelled", self->connection.imsi);
} else {
mms_connection_nemo_set_state(self, MMS_CONNECTION_STATE_CLOSED);
}
@@ -174,7 +174,7 @@ mms_connection_nemo_cancel_if_invalid(
void* arg)
{
if (!obj->valid) {
MMS_VERBOSE_("oops!");
GVERBOSE_("oops!");
mms_connection_nemo_cancel(MMS_CONNECTION_NEMO(arg));
}
}
@@ -186,9 +186,9 @@ mms_connection_nemo_active_changed(
void* arg)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_ASSERT(self->context == context);
GASSERT(self->context == context);
if (context->active) {
MMS_DEBUG("Connection %s opened", self->connection.imsi);
GDEBUG("Connection %s opened", self->connection.imsi);
mms_connection_nemo_set_state(self, MMS_CONNECTION_STATE_OPEN);
} else {
mms_connection_nemo_disconnect_context(self, CONTEXT_HANDLER_ACTIVE);
@@ -203,10 +203,10 @@ mms_connection_nemo_interface_changed(
void* arg)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_ASSERT(self->context == context);
GASSERT(self->context == context);
if (context->ifname) {
self->connection.netif = context->ifname;
MMS_DEBUG("Interface: %s", self->connection.netif);
GDEBUG("Interface: %s", self->connection.netif);
} else {
self->connection.netif = NULL;
}
@@ -219,10 +219,10 @@ mms_connection_nemo_mms_proxy_changed(
void* arg)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_ASSERT(self->context == context);
GASSERT(self->context == context);
if (context->mms_proxy) {
self->connection.mmsproxy = context->mms_proxy;
MMS_DEBUG("MessageProxy: %s", self->connection.mmsproxy);
GDEBUG("MessageProxy: %s", self->connection.mmsproxy);
} else {
self->connection.mmsproxy = NULL;
}
@@ -235,10 +235,10 @@ mms_connection_nemo_mms_center_changed(
void* arg)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_ASSERT(self->context == context);
GASSERT(self->context == context);
if (context->mms_center) {
self->connection.mmsc = context->mms_center;
MMS_DEBUG("MessageCenter: %s", self->connection.mmsc);
GDEBUG("MessageCenter: %s", self->connection.mmsc);
} else {
self->connection.mmsc = NULL;
}
@@ -252,7 +252,7 @@ mms_connection_nemo_activate_failed(
void* arg)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_ASSERT(self->context == context);
GASSERT(self->context == context);
mms_connection_nemo_cancel(self);
}

@@ -269,7 +269,7 @@ mms_connection_nemo_check_context(
} else {
OfonoConnMgr* connmgr = self->connmgr;
if (ofono_connmgr_valid(connmgr) && connmgr->attached) {
MMS_DEBUG("Activate %s", ofono_connctx_path(context));
GDEBUG("Activate %s", ofono_connctx_path(context));
ofono_connctx_activate(context);
}
}
@@ -283,7 +283,7 @@ mms_connection_nemo_connmgr_attached_changed(
void* arg)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_DEBUG("Data registration %s for %s", connmgr->attached ? "on" : "off",
GDEBUG("Data registration %s for %s", connmgr->attached ? "on" : "off",
ofono_connmgr_path(connmgr));
mms_connection_nemo_check_context(self);
}
@@ -307,15 +307,15 @@ mms_connection_nemo_setup_context(
/* Capture the current context state */
if (context->mms_proxy && context->mms_proxy[0]) {
conn->mmsproxy = context->mms_proxy;
MMS_DEBUG("MessageProxy: %s", conn->mmsproxy);
GDEBUG("MessageProxy: %s", conn->mmsproxy);
}
if (context->mms_center && context->mms_center[0]) {
conn->mmsc = context->mms_center;
MMS_DEBUG("MessageCenter: %s", conn->mmsc);
GDEBUG("MessageCenter: %s", conn->mmsc);
}
if (context->ifname && context->ifname[0]) {
conn->netif = context->ifname;
MMS_DEBUG("Interface: %s", conn->netif);
GDEBUG("Interface: %s", conn->netif);
}

/* Track context property changes */
@@ -364,8 +364,8 @@ void
mms_connection_nemo_init_context(
MMSConnectionNemo* self)
{
MMS_ASSERT(ofono_connmgr_valid(self->connmgr));
MMS_ASSERT(!self->context);
GASSERT(ofono_connmgr_valid(self->connmgr));
GASSERT(!self->context);

/* From this point on, cancel the connection if OfonoConnMgr becomes
* invalid (which would probably mean SIM removal or ofono crash) */
@@ -379,7 +379,7 @@ mms_connection_nemo_init_context(
self->context = ofono_connctx_ref(ofono_connmgr_get_context_for_type(
self->connmgr, OFONO_CONNCTX_TYPE_MMS));
if (self->context) {
MMS_DEBUG("MMS context %s", ofono_connctx_path(self->context));
GDEBUG("MMS context %s", ofono_connctx_path(self->context));
if (ofono_connctx_valid(self->context)) {
mms_connection_nemo_setup_context(self);
} else {
@@ -388,7 +388,7 @@ mms_connection_nemo_init_context(
mms_connection_nemo_context_valid_changed, self);
}
} else {
MMS_WARN("No MMS context");
GWARN("No MMS context");
mms_connection_nemo_cancel(self);
}
}
@@ -414,7 +414,7 @@ mms_connection_nemo_mms_imsi_changed(
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
if (mm->valid && g_strcmp0(mm->mms_imsi, self->connection.imsi)) {
MMS_VERBOSE_("%s", mm->mms_imsi);
GVERBOSE_("%s", mm->mms_imsi);
mms_connection_nemo_cancel(self);
}
}
@@ -431,9 +431,9 @@ mms_connection_nemo_set_mms_imsi_done(
if (error) {
mms_connection_nemo_cancel(self);
} else {
MMS_DEBUG("MMS modem path %s", path);
MMS_ASSERT(!self->path);
MMS_ASSERT(!self->connmgr);
GDEBUG("MMS modem path %s", path);
GASSERT(!self->path);
GASSERT(!self->connmgr);
self->path = g_strdup(path);

if (self->connection.state == MMS_CONNECTION_STATE_OPENING) {
@@ -454,7 +454,7 @@ mms_connection_nemo_set_mms_imsi_done(
}
} else {
/* Connection has been cancelled, release the slot */
MMS_DEBUG("Canceled, releasing %s", path);
GDEBUG("Canceled, releasing %s", path);
mms_connection_ref(&self->connection);
mms_connman_busy_inc(self->cm);
ofonoext_mm_set_mms_imsi_full(self->mm, "",
@@ -473,7 +473,7 @@ mms_connection_nemo_cancel_if_mm_invalid(
void* arg)
{
if (!mm->valid) {
MMS_VERBOSE_("oops!");
GVERBOSE_("oops!");
mms_connection_nemo_cancel(MMS_CONNECTION_NEMO(arg));
}
}
@@ -504,7 +504,7 @@ mms_connection_nemo_mm_valid_changed(
OfonoExtModemManager* mm,
void* arg)
{
MMS_VERBOSE_("%p %d", arg, mm->valid);
GVERBOSE_("%p %d", arg, mm->valid);
if (mm->valid) {
mms_connection_nemo_request_sim(arg);
}
@@ -519,7 +519,7 @@ mms_connection_nemo_new(
MMSConnectionNemo* self = g_object_new(MMS_TYPE_CONNECTION_NEMO, NULL);
MMSConnection* conn = &self->connection;

MMS_VERBOSE_("%p %s", self, imsi);
GVERBOSE_("%p %s", self, imsi);
conn->type = type;
conn->imsi = self->imsi = g_strdup(imsi);
conn->state = MMS_CONNECTION_STATE_OPENING;
@@ -545,7 +545,7 @@ mms_connection_nemo_close(
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(connection);
OfonoConnCtx* context = self->context;
if (ofono_connctx_valid(context) && context->active) {
MMS_DEBUG("Deactivate %s", ofono_connctx_path(context));
GDEBUG("Deactivate %s", ofono_connctx_path(context));
ofono_connctx_deactivate(context);
} else {
mms_connection_nemo_cancel(self);
@@ -562,8 +562,8 @@ mms_connection_nemo_dispose(
GObject* object)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(object);
MMS_VERBOSE_("%p %s", self, self->imsi);
MMS_ASSERT(!mms_connection_is_active(&self->connection));
GVERBOSE_("%p %s", self, self->imsi);
GASSERT(!mms_connection_is_active(&self->connection));
mms_connection_nemo_disconnect(self);
if (self->context) {
if (mms_connection_is_active(&self->connection) &&
@@ -586,7 +586,7 @@ mms_connection_nemo_finalize(
GObject* object)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(object);
MMS_VERBOSE_("%p %s", self, self->imsi);
GVERBOSE_("%p %s", self, self->imsi);
ofono_connmgr_unref(self->connmgr);
ofono_connctx_unref(self->context);
ofonoext_mm_unref(self->mm);
@@ -618,7 +618,7 @@ void
mms_connection_nemo_init(
MMSConnectionNemo* self)
{
MMS_VERBOSE_("%p", self);
GVERBOSE_("%p", self);
}

/*
@@ -10,7 +10,6 @@
* 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.
*
*/

#include "mms_connman_nemo.h"
@@ -20,9 +19,10 @@
#include <gofono_modem.h>

/* Logging */
#define MMS_LOG_MODULE_NAME mms_connman_log
#define GLOG_MODULE_NAME mms_connman_log
#include "mms_connman_nemo_log.h"
MMS_LOG_MODULE_DEFINE("mms-connman-nemo");
#include <gutil_log.h>
GLOG_MODULE_DEFINE("mms-connman-nemo");

enum mm_event {
MM_EVENT_VALID,
@@ -79,10 +79,10 @@ mms_connman_nemo_check_default_sim(
if (g_strcmp0(path, ofono_simmgr_path(self->default_sim))) {
ofono_simmgr_unref(self->default_sim);
if (path) {
MMS_DEBUG("Default SIM at %s", path);
GDEBUG("Default SIM at %s", path);
self->default_sim = ofono_simmgr_new(path);
} else {
MMS_DEBUG("No default SIM");
GDEBUG("No default SIM");
self->default_sim = NULL;
}
}
@@ -136,10 +136,10 @@ mms_connman_nemo_default_imsi(
ofono_simmgr_wait_valid(self->default_sim, MMS_INIT_TIMEOUT_MS, 0) &&
self->default_sim /* Check it again */ &&
self->default_sim->imsi) {
MMS_DEBUG("Default IMSI %s", self->default_sim->imsi);
GDEBUG("Default IMSI %s", self->default_sim->imsi);
return g_strdup(self->default_sim->imsi);
}
MMS_DEBUG("No default IMSI");
GDEBUG("No default IMSI");
return NULL;
}

@@ -153,8 +153,8 @@ mms_connman_nemo_connection_weak_ref_notify(
GObject* connection)
{
MMSConnManNemo* self = MMS_CONNMAN_NEMO(arg);
MMS_ASSERT(MMS_CONNECTION(connection) == self->conn);
MMS_VERBOSE_("%p", connection);
GASSERT(MMS_CONNECTION(connection) == self->conn);
GVERBOSE_("%p", connection);
self->conn_change_id = 0;
self->conn = NULL;
}
@@ -168,7 +168,7 @@ mms_connman_nemo_drop_connection(
MMSConnManNemo* self)
{
if (self->conn) {
MMS_VERBOSE_("%p", self->conn);
GVERBOSE_("%p", self->conn);
mms_connection_remove_handler(self->conn, self->conn_change_id);
self->conn_change_id = 0;
g_object_weak_unref(G_OBJECT(self->conn),
@@ -187,7 +187,7 @@ mms_connman_nemo_connection_state_changed(
void* arg)
{
MMSConnManNemo* self = MMS_CONNMAN_NEMO(arg);
MMS_ASSERT(connection == self->conn);
GASSERT(connection == self->conn);
if (self->conn && !mms_connection_is_active(self->conn)) {
mms_connman_nemo_drop_connection(self);
}
@@ -216,7 +216,7 @@ mms_connman_nemo_open_connection(
self->conn = mms_connection_nemo_new(cm, imsi, type);
self->conn_change_id = mms_connection_add_state_change_handler(self->conn,
mms_connman_nemo_connection_state_changed, self);
MMS_ASSERT(mms_connection_is_active(self->conn));
GASSERT(mms_connection_is_active(self->conn));
g_object_weak_ref(G_OBJECT(self->conn),
mms_connman_nemo_connection_weak_ref_notify, self);
return self->conn;
@@ -260,7 +260,7 @@ mms_connman_nemo_finalize(
GObject* object)
{
MMSConnManNemo* self = MMS_CONNMAN_NEMO(object);
MMS_VERBOSE_("");
GVERBOSE_("");
ofonoext_mm_unref(self->mm);
G_OBJECT_CLASS(mms_connman_nemo_parent_class)->finalize(object);
}
@@ -288,7 +288,7 @@ void
mms_connman_nemo_init(
MMSConnManNemo* self)
{
MMS_VERBOSE_("");
GVERBOSE_("");
self->mm = ofonoext_mm_new();
self->mm_event_id[MM_EVENT_VALID] =
ofonoext_mm_add_valid_changed_handler(self->mm,

0 comments on commit b9fe742

Please sign in to comment.