Commit b9fe7422 authored by Slava Monich's avatar Slava Monich

[mms-engine] Logging cleanup. MER#1027

Logging functionality that used to be part of mms-engine has been
migrated to libglibutil
parent f4d77484
...@@ -10,13 +10,12 @@ ...@@ -10,13 +10,12 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
*
*/ */
#ifndef JOLLA_MMS_CONNMAN_NEMO_LOG_H #ifndef JOLLA_MMS_CONNMAN_NEMO_LOG_H
#define 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) \ #define MMS_CONNMAN_LOG_MODULES(log) \
log(gofonoext_log) \ log(gofonoext_log) \
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
*
*/ */
#include "mms_connection_nemo.h" #include "mms_connection_nemo.h"
...@@ -20,9 +19,10 @@ ...@@ -20,9 +19,10 @@
#include <gofono_connctx.h> #include <gofono_connctx.h>
/* Logging */ /* Logging */
#define MMS_LOG_MODULE_NAME mms_connection_log #define GLOG_MODULE_NAME mms_connection_log
#include "mms_connman_nemo_log.h" #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 { enum mm_handler_id {
MM_HANDLER_VALID, MM_HANDLER_VALID,
...@@ -113,7 +113,7 @@ mms_connection_nemo_reset_mms_imsi_done( ...@@ -113,7 +113,7 @@ mms_connection_nemo_reset_mms_imsi_done(
void* arg) void* arg)
{ {
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(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_connman_busy_dec(self->cm);
mms_connection_unref(&self->connection); mms_connection_unref(&self->connection);
} }
...@@ -161,7 +161,7 @@ mms_connection_nemo_cancel( ...@@ -161,7 +161,7 @@ mms_connection_nemo_cancel(
{ {
if (self->connection.state <= MMS_CONNECTION_STATE_OPENING && if (self->connection.state <= MMS_CONNECTION_STATE_OPENING &&
mms_connection_nemo_set_state(self, MMS_CONNECTION_STATE_FAILED)) { 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 { } else {
mms_connection_nemo_set_state(self, MMS_CONNECTION_STATE_CLOSED); mms_connection_nemo_set_state(self, MMS_CONNECTION_STATE_CLOSED);
} }
...@@ -174,7 +174,7 @@ mms_connection_nemo_cancel_if_invalid( ...@@ -174,7 +174,7 @@ mms_connection_nemo_cancel_if_invalid(
void* arg) void* arg)
{ {
if (!obj->valid) { if (!obj->valid) {
MMS_VERBOSE_("oops!"); GVERBOSE_("oops!");
mms_connection_nemo_cancel(MMS_CONNECTION_NEMO(arg)); mms_connection_nemo_cancel(MMS_CONNECTION_NEMO(arg));
} }
} }
...@@ -186,9 +186,9 @@ mms_connection_nemo_active_changed( ...@@ -186,9 +186,9 @@ mms_connection_nemo_active_changed(
void* arg) void* arg)
{ {
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg); MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_ASSERT(self->context == context); GASSERT(self->context == context);
if (context->active) { 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); mms_connection_nemo_set_state(self, MMS_CONNECTION_STATE_OPEN);
} else { } else {
mms_connection_nemo_disconnect_context(self, CONTEXT_HANDLER_ACTIVE); mms_connection_nemo_disconnect_context(self, CONTEXT_HANDLER_ACTIVE);
...@@ -203,10 +203,10 @@ mms_connection_nemo_interface_changed( ...@@ -203,10 +203,10 @@ mms_connection_nemo_interface_changed(
void* arg) void* arg)
{ {
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg); MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_ASSERT(self->context == context); GASSERT(self->context == context);
if (context->ifname) { if (context->ifname) {
self->connection.netif = context->ifname; self->connection.netif = context->ifname;
MMS_DEBUG("Interface: %s", self->connection.netif); GDEBUG("Interface: %s", self->connection.netif);
} else { } else {
self->connection.netif = NULL; self->connection.netif = NULL;
} }
...@@ -219,10 +219,10 @@ mms_connection_nemo_mms_proxy_changed( ...@@ -219,10 +219,10 @@ mms_connection_nemo_mms_proxy_changed(
void* arg) void* arg)
{ {
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg); MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_ASSERT(self->context == context); GASSERT(self->context == context);
if (context->mms_proxy) { if (context->mms_proxy) {
self->connection.mmsproxy = context->mms_proxy; self->connection.mmsproxy = context->mms_proxy;
MMS_DEBUG("MessageProxy: %s", self->connection.mmsproxy); GDEBUG("MessageProxy: %s", self->connection.mmsproxy);
} else { } else {
self->connection.mmsproxy = NULL; self->connection.mmsproxy = NULL;
} }
...@@ -235,10 +235,10 @@ mms_connection_nemo_mms_center_changed( ...@@ -235,10 +235,10 @@ mms_connection_nemo_mms_center_changed(
void* arg) void* arg)
{ {
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg); MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_ASSERT(self->context == context); GASSERT(self->context == context);
if (context->mms_center) { if (context->mms_center) {
self->connection.mmsc = context->mms_center; self->connection.mmsc = context->mms_center;
MMS_DEBUG("MessageCenter: %s", self->connection.mmsc); GDEBUG("MessageCenter: %s", self->connection.mmsc);
} else { } else {
self->connection.mmsc = NULL; self->connection.mmsc = NULL;
} }
...@@ -252,7 +252,7 @@ mms_connection_nemo_activate_failed( ...@@ -252,7 +252,7 @@ mms_connection_nemo_activate_failed(
void* arg) void* arg)
{ {
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg); MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_ASSERT(self->context == context); GASSERT(self->context == context);
mms_connection_nemo_cancel(self); mms_connection_nemo_cancel(self);
} }
...@@ -269,7 +269,7 @@ mms_connection_nemo_check_context( ...@@ -269,7 +269,7 @@ mms_connection_nemo_check_context(
} else { } else {
OfonoConnMgr* connmgr = self->connmgr; OfonoConnMgr* connmgr = self->connmgr;
if (ofono_connmgr_valid(connmgr) && connmgr->attached) { 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); ofono_connctx_activate(context);
} }
} }
...@@ -283,7 +283,7 @@ mms_connection_nemo_connmgr_attached_changed( ...@@ -283,7 +283,7 @@ mms_connection_nemo_connmgr_attached_changed(
void* arg) void* arg)
{ {
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(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)); ofono_connmgr_path(connmgr));
mms_connection_nemo_check_context(self); mms_connection_nemo_check_context(self);
} }
...@@ -307,15 +307,15 @@ mms_connection_nemo_setup_context( ...@@ -307,15 +307,15 @@ mms_connection_nemo_setup_context(
/* Capture the current context state */ /* Capture the current context state */
if (context->mms_proxy && context->mms_proxy[0]) { if (context->mms_proxy && context->mms_proxy[0]) {
conn->mmsproxy = context->mms_proxy; conn->mmsproxy = context->mms_proxy;
MMS_DEBUG("MessageProxy: %s", conn->mmsproxy); GDEBUG("MessageProxy: %s", conn->mmsproxy);
} }
if (context->mms_center && context->mms_center[0]) { if (context->mms_center && context->mms_center[0]) {
conn->mmsc = context->mms_center; conn->mmsc = context->mms_center;
MMS_DEBUG("MessageCenter: %s", conn->mmsc); GDEBUG("MessageCenter: %s", conn->mmsc);
} }
if (context->ifname && context->ifname[0]) { if (context->ifname && context->ifname[0]) {
conn->netif = context->ifname; conn->netif = context->ifname;
MMS_DEBUG("Interface: %s", conn->netif); GDEBUG("Interface: %s", conn->netif);
} }
/* Track context property changes */ /* Track context property changes */
...@@ -364,8 +364,8 @@ void ...@@ -364,8 +364,8 @@ void
mms_connection_nemo_init_context( mms_connection_nemo_init_context(
MMSConnectionNemo* self) MMSConnectionNemo* self)
{ {
MMS_ASSERT(ofono_connmgr_valid(self->connmgr)); GASSERT(ofono_connmgr_valid(self->connmgr));
MMS_ASSERT(!self->context); GASSERT(!self->context);
/* From this point on, cancel the connection if OfonoConnMgr becomes /* From this point on, cancel the connection if OfonoConnMgr becomes
* invalid (which would probably mean SIM removal or ofono crash) */ * invalid (which would probably mean SIM removal or ofono crash) */
...@@ -379,7 +379,7 @@ mms_connection_nemo_init_context( ...@@ -379,7 +379,7 @@ mms_connection_nemo_init_context(
self->context = ofono_connctx_ref(ofono_connmgr_get_context_for_type( self->context = ofono_connctx_ref(ofono_connmgr_get_context_for_type(
self->connmgr, OFONO_CONNCTX_TYPE_MMS)); self->connmgr, OFONO_CONNCTX_TYPE_MMS));
if (self->context) { 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)) { if (ofono_connctx_valid(self->context)) {
mms_connection_nemo_setup_context(self); mms_connection_nemo_setup_context(self);
} else { } else {
...@@ -388,7 +388,7 @@ mms_connection_nemo_init_context( ...@@ -388,7 +388,7 @@ mms_connection_nemo_init_context(
mms_connection_nemo_context_valid_changed, self); mms_connection_nemo_context_valid_changed, self);
} }
} else { } else {
MMS_WARN("No MMS context"); GWARN("No MMS context");
mms_connection_nemo_cancel(self); mms_connection_nemo_cancel(self);
} }
} }
...@@ -414,7 +414,7 @@ mms_connection_nemo_mms_imsi_changed( ...@@ -414,7 +414,7 @@ mms_connection_nemo_mms_imsi_changed(
{ {
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg); MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
if (mm->valid && g_strcmp0(mm->mms_imsi, self->connection.imsi)) { 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); mms_connection_nemo_cancel(self);
} }
} }
...@@ -431,9 +431,9 @@ mms_connection_nemo_set_mms_imsi_done( ...@@ -431,9 +431,9 @@ mms_connection_nemo_set_mms_imsi_done(
if (error) { if (error) {
mms_connection_nemo_cancel(self); mms_connection_nemo_cancel(self);
} else { } else {
MMS_DEBUG("MMS modem path %s", path); GDEBUG("MMS modem path %s", path);
MMS_ASSERT(!self->path); GASSERT(!self->path);
MMS_ASSERT(!self->connmgr); GASSERT(!self->connmgr);
self->path = g_strdup(path); self->path = g_strdup(path);
if (self->connection.state == MMS_CONNECTION_STATE_OPENING) { if (self->connection.state == MMS_CONNECTION_STATE_OPENING) {
...@@ -454,7 +454,7 @@ mms_connection_nemo_set_mms_imsi_done( ...@@ -454,7 +454,7 @@ mms_connection_nemo_set_mms_imsi_done(
} }
} else { } else {
/* Connection has been cancelled, release the slot */ /* Connection has been cancelled, release the slot */
MMS_DEBUG("Canceled, releasing %s", path); GDEBUG("Canceled, releasing %s", path);
mms_connection_ref(&self->connection); mms_connection_ref(&self->connection);
mms_connman_busy_inc(self->cm); mms_connman_busy_inc(self->cm);
ofonoext_mm_set_mms_imsi_full(self->mm, "", ofonoext_mm_set_mms_imsi_full(self->mm, "",
...@@ -473,7 +473,7 @@ mms_connection_nemo_cancel_if_mm_invalid( ...@@ -473,7 +473,7 @@ mms_connection_nemo_cancel_if_mm_invalid(
void* arg) void* arg)
{ {
if (!mm->valid) { if (!mm->valid) {
MMS_VERBOSE_("oops!"); GVERBOSE_("oops!");
mms_connection_nemo_cancel(MMS_CONNECTION_NEMO(arg)); mms_connection_nemo_cancel(MMS_CONNECTION_NEMO(arg));
} }
} }
...@@ -504,7 +504,7 @@ mms_connection_nemo_mm_valid_changed( ...@@ -504,7 +504,7 @@ mms_connection_nemo_mm_valid_changed(
OfonoExtModemManager* mm, OfonoExtModemManager* mm,
void* arg) void* arg)
{ {
MMS_VERBOSE_("%p %d", arg, mm->valid); GVERBOSE_("%p %d", arg, mm->valid);
if (mm->valid) { if (mm->valid) {
mms_connection_nemo_request_sim(arg); mms_connection_nemo_request_sim(arg);
} }
...@@ -519,7 +519,7 @@ mms_connection_nemo_new( ...@@ -519,7 +519,7 @@ mms_connection_nemo_new(
MMSConnectionNemo* self = g_object_new(MMS_TYPE_CONNECTION_NEMO, NULL); MMSConnectionNemo* self = g_object_new(MMS_TYPE_CONNECTION_NEMO, NULL);
MMSConnection* conn = &self->connection; MMSConnection* conn = &self->connection;
MMS_VERBOSE_("%p %s", self, imsi); GVERBOSE_("%p %s", self, imsi);
conn->type = type; conn->type = type;
conn->imsi = self->imsi = g_strdup(imsi); conn->imsi = self->imsi = g_strdup(imsi);
conn->state = MMS_CONNECTION_STATE_OPENING; conn->state = MMS_CONNECTION_STATE_OPENING;
...@@ -545,7 +545,7 @@ mms_connection_nemo_close( ...@@ -545,7 +545,7 @@ mms_connection_nemo_close(
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(connection); MMSConnectionNemo* self = MMS_CONNECTION_NEMO(connection);
OfonoConnCtx* context = self->context; OfonoConnCtx* context = self->context;
if (ofono_connctx_valid(context) && context->active) { 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); ofono_connctx_deactivate(context);
} else { } else {
mms_connection_nemo_cancel(self); mms_connection_nemo_cancel(self);
...@@ -562,8 +562,8 @@ mms_connection_nemo_dispose( ...@@ -562,8 +562,8 @@ mms_connection_nemo_dispose(
GObject* object) GObject* object)
{ {
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(object); MMSConnectionNemo* self = MMS_CONNECTION_NEMO(object);
MMS_VERBOSE_("%p %s", self, self->imsi); GVERBOSE_("%p %s", self, self->imsi);
MMS_ASSERT(!mms_connection_is_active(&self->connection)); GASSERT(!mms_connection_is_active(&self->connection));
mms_connection_nemo_disconnect(self); mms_connection_nemo_disconnect(self);
if (self->context) { if (self->context) {
if (mms_connection_is_active(&self->connection) && if (mms_connection_is_active(&self->connection) &&
...@@ -586,7 +586,7 @@ mms_connection_nemo_finalize( ...@@ -586,7 +586,7 @@ mms_connection_nemo_finalize(
GObject* object) GObject* object)
{ {
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(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_connmgr_unref(self->connmgr);
ofono_connctx_unref(self->context); ofono_connctx_unref(self->context);
ofonoext_mm_unref(self->mm); ofonoext_mm_unref(self->mm);
...@@ -618,7 +618,7 @@ void ...@@ -618,7 +618,7 @@ void
mms_connection_nemo_init( mms_connection_nemo_init(
MMSConnectionNemo* self) MMSConnectionNemo* self)
{ {
MMS_VERBOSE_("%p", self); GVERBOSE_("%p", self);
} }
/* /*
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
*
*/ */
#include "mms_connman_nemo.h" #include "mms_connman_nemo.h"
...@@ -20,9 +19,10 @@ ...@@ -20,9 +19,10 @@
#include <gofono_modem.h> #include <gofono_modem.h>
/* Logging */ /* Logging */
#define MMS_LOG_MODULE_NAME mms_connman_log #define GLOG_MODULE_NAME mms_connman_log
#include "mms_connman_nemo_log.h" #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 { enum mm_event {
MM_EVENT_VALID, MM_EVENT_VALID,
...@@ -79,10 +79,10 @@ mms_connman_nemo_check_default_sim( ...@@ -79,10 +79,10 @@ mms_connman_nemo_check_default_sim(
if (g_strcmp0(path, ofono_simmgr_path(self->default_sim))) { if (g_strcmp0(path, ofono_simmgr_path(self->default_sim))) {
ofono_simmgr_unref(self->default_sim); ofono_simmgr_unref(self->default_sim);
if (path) { if (path) {
MMS_DEBUG("Default SIM at %s", path); GDEBUG("Default SIM at %s", path);
self->default_sim = ofono_simmgr_new(path); self->default_sim = ofono_simmgr_new(path);
} else { } else {
MMS_DEBUG("No default SIM"); GDEBUG("No default SIM");
self->default_sim = NULL; self->default_sim = NULL;
} }
} }
...@@ -136,10 +136,10 @@ mms_connman_nemo_default_imsi( ...@@ -136,10 +136,10 @@ mms_connman_nemo_default_imsi(
ofono_simmgr_wait_valid(self->default_sim, MMS_INIT_TIMEOUT_MS, 0) && ofono_simmgr_wait_valid(self->default_sim, MMS_INIT_TIMEOUT_MS, 0) &&
self->default_sim /* Check it again */ && self->default_sim /* Check it again */ &&
self->default_sim->imsi) { 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); return g_strdup(self->default_sim->imsi);
} }
MMS_DEBUG("No default IMSI"); GDEBUG("No default IMSI");
return NULL; return NULL;
} }
...@@ -153,8 +153,8 @@ mms_connman_nemo_connection_weak_ref_notify( ...@@ -153,8 +153,8 @@ mms_connman_nemo_connection_weak_ref_notify(
GObject* connection) GObject* connection)
{ {
MMSConnManNemo* self = MMS_CONNMAN_NEMO(arg); MMSConnManNemo* self = MMS_CONNMAN_NEMO(arg);
MMS_ASSERT(MMS_CONNECTION(connection) == self->conn); GASSERT(MMS_CONNECTION(connection) == self->conn);
MMS_VERBOSE_("%p", connection); GVERBOSE_("%p", connection);
self->conn_change_id = 0; self->conn_change_id = 0;
self->conn = NULL; self->conn = NULL;
} }
...@@ -168,7 +168,7 @@ mms_connman_nemo_drop_connection( ...@@ -168,7 +168,7 @@ mms_connman_nemo_drop_connection(
MMSConnManNemo* self) MMSConnManNemo* self)
{ {
if (self->conn) { if (self->conn) {
MMS_VERBOSE_("%p", self->conn); GVERBOSE_("%p", self->conn);
mms_connection_remove_handler(self->conn, self->conn_change_id); mms_connection_remove_handler(self->conn, self->conn_change_id);
self->conn_change_id = 0; self->conn_change_id = 0;
g_object_weak_unref(G_OBJECT(self->conn), g_object_weak_unref(G_OBJECT(self->conn),
...@@ -187,7 +187,7 @@ mms_connman_nemo_connection_state_changed( ...@@ -187,7 +187,7 @@ mms_connman_nemo_connection_state_changed(
void* arg) void* arg)
{ {
MMSConnManNemo* self = MMS_CONNMAN_NEMO(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)) { if (self->conn && !mms_connection_is_active(self->conn)) {
mms_connman_nemo_drop_connection(self); mms_connman_nemo_drop_connection(self);
} }
...@@ -216,7 +216,7 @@ mms_connman_nemo_open_connection( ...@@ -216,7 +216,7 @@ mms_connman_nemo_open_connection(
self->conn = mms_connection_nemo_new(cm, imsi, type); self->conn = mms_connection_nemo_new(cm, imsi, type);
self->conn_change_id = mms_connection_add_state_change_handler(self->conn, self->conn_change_id = mms_connection_add_state_change_handler(self->conn,
mms_connman_nemo_connection_state_changed, self); 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), g_object_weak_ref(G_OBJECT(self->conn),
mms_connman_nemo_connection_weak_ref_notify, self); mms_connman_nemo_connection_weak_ref_notify, self);
return self->conn; return self->conn;
...@@ -260,7 +260,7 @@ mms_connman_nemo_finalize( ...@@ -260,7 +260,7 @@ mms_connman_nemo_finalize(
GObject* object) GObject* object)
{ {
MMSConnManNemo* self = MMS_CONNMAN_NEMO(object); MMSConnManNemo* self = MMS_CONNMAN_NEMO(object);
MMS_VERBOSE_(""); GVERBOSE_("");
ofonoext_mm_unref(self->mm); ofonoext_mm_unref(self->mm);
G_OBJECT_CLASS(mms_connman_nemo_parent_class)->finalize(object); G_OBJECT_CLASS(mms_connman_nemo_parent_class)->finalize(object);
} }
...@@ -288,7 +288,7 @@ void ...@@ -288,7 +288,7 @@ void
mms_connman_nemo_init( mms_connman_nemo_init(
MMSConnManNemo* self) MMSConnManNemo* self)
{ {
MMS_VERBOSE_(""); GVERBOSE_("");
self->mm = ofonoext_mm_new(); self->mm = ofonoext_mm_new();
self->mm_event_id[MM_EVENT_VALID] = self->mm_event_id[MM_EVENT_VALID] =
ofonoext_mm_add_valid_changed_handler(self->mm, ofonoext_mm_add_valid_changed_handler(self->mm,
......
...@@ -10,13 +10,12 @@ ...@@ -10,13 +10,12 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
*
*/ */
#ifndef JOLLA_MMS_CONNMAN_OFONO_LOG_H #ifndef JOLLA_MMS_CONNMAN_OFONO_LOG_H
#define JOLLA_MMS_CONNMAN_OFONO_LOG_H #define JOLLA_MMS_CONNMAN_OFONO_LOG_H
#include "mms_log.h" #include "mms_lib_types.h"
#define MMS_CONNMAN_LOG_MODULES(log) \ #define MMS_CONNMAN_LOG_MODULES(log) \
log(gofono_log) log(gofono_log)
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
*
*/ */
#include "mms_connection_ofono.h" #include "mms_connection_ofono.h"
...@@ -19,9 +18,10 @@ ...@@ -19,9 +18,10 @@
#include <gofono_simmgr.h> #include <gofono_simmgr.h>
/* Logging */ /* Logging */
#define MMS_LOG_MODULE_NAME mms_connection_log #define GLOG_MODULE_NAME mms_connection_log
#include "mms_connman_ofono_log.h" #include "mms_connman_ofono_log.h"
MMS_LOG_MODULE_DEFINE("mms-connection-ofono"); #include <gutil_log.h>
GLOG_MODULE_DEFINE("mms-connection-ofono");
enum context_handler_id { enum context_handler_id {
CONTEXT_HANDLER_ACTIVATE_FAILED, CONTEXT_HANDLER_ACTIVATE_FAILED,
...@@ -109,9 +109,9 @@ mms_connection_ofono_active_changed( ...@@ -109,9 +109,9 @@ mms_connection_ofono_active_changed(
void* arg) void* arg)
{ {
MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg); MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg);
MMS_ASSERT(self->context == context); GASSERT(self->context == context);
if (context->active) { if (context->active) {
MMS_DEBUG("Connection %s opened", self->connection.imsi); GDEBUG("Connection %s opened", self->connection.imsi);
mms_connection_ofono_set_state(self, MMS_CONNECTION_STATE_OPEN); mms_connection_ofono_set_state(self, MMS_CONNECTION_STATE_OPEN);
} else { } else {
mms_connection_ofono_set_state(self, MMS_CONNECTION_STATE_CLOSED); mms_connection_ofono_set_state(self, MMS_CONNECTION_STATE_CLOSED);
...@@ -125,10 +125,10 @@ mms_connection_ofono_interface_changed( ...@@ -125,10 +125,10 @@ mms_connection_ofono_interface_changed(
void* arg) void* arg)
{ {
MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg); MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg);
MMS_ASSERT(self->context == context); GASSERT(self->context == context);
if (context->ifname) { if (context->ifname) {
self->connection.netif = context->ifname; self->connection.netif = context->ifname;
MMS_DEBUG("Interface: %s", self->connection.netif); GDEBUG("Interface: %s", self->connection.netif);
} else { } else {
self->connection.netif = NULL; self->connection.netif = NULL;
} }
...@@ -141,10 +141,10 @@ mms_connection_ofono_mms_proxy_changed( ...@@ -141,10 +141,10 @@ mms_connection_ofono_mms_proxy_changed(
void* arg) void* arg)
{ {
MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg); MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg);
MMS_ASSERT(self->context == context); GASSERT(self->context == context);
if (context->mms_proxy) { if (context->mms_proxy) {
self->connection.mmsproxy = context->mms_proxy; self->connection.mmsproxy = context->mms_proxy;
MMS_DEBUG("MessageProxy: %s", self->connection.mmsproxy); GDEBUG("MessageProxy: %s", self->connection.mmsproxy);
} else { } else {
self->connection.mmsproxy = NULL; self->connection.mmsproxy = NULL;
} }
...@@ -157,10 +157,10 @@ mms_connection_ofono_mms_center_changed( ...@@ -157,10 +157,10 @@ mms_connection_ofono_mms_center_changed(
void* arg) void* arg)
{ {
MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg); MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg);
MMS_ASSERT(self->context == context); GASSERT(self->context == context);
if (context->mms_center) { if (context->mms_center) {
self->connection.mmsc = context->mms_center; self->connection.mmsc = context->mms_center;
MMS_DEBUG("MessageCenter: %s", self->connection.mmsc); GDEBUG("MessageCenter: %s", self->connection.mmsc);
} else { } else {
self->connection.mmsc = NULL; self->connection.mmsc = NULL;
} }
...@@ -173,9 +173,9 @@ mms_connection_ofono_imsi_changed( ...@@ -173,9 +173,9 @@ mms_connection_ofono_imsi_changed(
void* arg) void* arg)
{ {
MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg); MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg);
MMS_ASSERT(self->sim == sim); GASSERT(self->sim == sim);
if (g_strcmp0(sim->imsi, self->connection.