cli: logging improvements
This commit is contained in:
+2
-2
@@ -130,11 +130,11 @@ find_modem (MMManager *manager,
|
||||
g_list_free (modems);
|
||||
|
||||
if (!found) {
|
||||
g_printerr ("error: couldn't find the Modem at '%s'\n", modem_path);
|
||||
g_printerr ("error: couldn't find modem at '%s'\n", modem_path);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
g_debug ("Modem found at '%s'", modem_path);
|
||||
g_debug ("Modem found at '%s'\n", modem_path);
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
+19
-10
@@ -179,18 +179,29 @@ scan_devices_ready (MMManager *manager,
|
||||
}
|
||||
|
||||
static void
|
||||
device_added (GDBusObjectManager *manager,
|
||||
GDBusObject *object)
|
||||
print_modem_short_info (MMModem *modem)
|
||||
{
|
||||
g_print ("Added modem [TODO: Print path]\n");
|
||||
g_print ("\t%s [%s] %s\n",
|
||||
mm_modem_get_path (modem),
|
||||
mm_modem_get_manufacturer (modem),
|
||||
mm_modem_get_model (modem));
|
||||
}
|
||||
|
||||
static void
|
||||
device_added (MMManager *manager,
|
||||
MMModem *modem)
|
||||
{
|
||||
g_print ("Added modem:\n");
|
||||
print_modem_short_info (modem);
|
||||
fflush (stdout);
|
||||
}
|
||||
|
||||
static void
|
||||
device_removed (GDBusObjectManager *manager,
|
||||
GDBusObject *object)
|
||||
device_removed (MMManager *manager,
|
||||
MMModem *modem)
|
||||
{
|
||||
g_print ("Removed modem [TODO: Print path]\n");
|
||||
g_print ("Removed modem:\n");
|
||||
print_modem_short_info (modem);
|
||||
fflush (stdout);
|
||||
}
|
||||
|
||||
@@ -209,14 +220,12 @@ list_current_modems (MMManager *manager)
|
||||
|
||||
g_print ("Found %u modems:\n", g_list_length (modems));
|
||||
for (l = modems; l; l = g_list_next (l)) {
|
||||
MMModem *modem = MM_MODEM (l->data);
|
||||
|
||||
g_print ("\t%s\n",
|
||||
mm_modem_get_path (modem));
|
||||
print_modem_short_info (MM_MODEM (l->data));
|
||||
}
|
||||
g_list_foreach (modems, (GFunc)g_object_unref, NULL);
|
||||
g_list_free (modems);
|
||||
}
|
||||
g_print ("\n");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -515,6 +515,7 @@ get_modem_ready (GObject *source,
|
||||
|
||||
/* Request to enable the modem? */
|
||||
if (enable_flag) {
|
||||
g_debug ("Asynchronously enabling modem...");
|
||||
mm_modem_enable (ctx->modem,
|
||||
ctx->cancellable,
|
||||
(GAsyncReadyCallback)enable_ready,
|
||||
@@ -524,6 +525,7 @@ get_modem_ready (GObject *source,
|
||||
|
||||
/* Request to disable the modem? */
|
||||
if (disable_flag) {
|
||||
g_debug ("Asynchronously disabling modem...");
|
||||
mm_modem_disable (ctx->modem,
|
||||
ctx->cancellable,
|
||||
(GAsyncReadyCallback)disable_ready,
|
||||
@@ -533,6 +535,7 @@ get_modem_ready (GObject *source,
|
||||
|
||||
/* Request to reset the modem? */
|
||||
if (reset_flag) {
|
||||
g_debug ("Asynchronously reseting modem...");
|
||||
mm_modem_reset (ctx->modem,
|
||||
ctx->cancellable,
|
||||
(GAsyncReadyCallback)reset_ready,
|
||||
@@ -542,6 +545,7 @@ get_modem_ready (GObject *source,
|
||||
|
||||
/* Request to reset the modem to factory state? */
|
||||
if (factory_reset_str) {
|
||||
g_debug ("Asynchronously factory-reseting modem...");
|
||||
mm_modem_factory_reset (ctx->modem,
|
||||
factory_reset_str,
|
||||
ctx->cancellable,
|
||||
@@ -612,6 +616,7 @@ mmcli_modem_run_synchronous (GDBusConnection *connection)
|
||||
if (enable_flag) {
|
||||
gboolean result;
|
||||
|
||||
g_debug ("Synchronously enabling modem...");
|
||||
result = mm_modem_enable_sync (ctx->modem, NULL, &error);
|
||||
enable_process_reply (result, error);
|
||||
return;
|
||||
@@ -621,6 +626,7 @@ mmcli_modem_run_synchronous (GDBusConnection *connection)
|
||||
if (disable_flag) {
|
||||
gboolean result;
|
||||
|
||||
g_debug ("Synchronously disabling modem...");
|
||||
result = mm_modem_disable_sync (ctx->modem, NULL, &error);
|
||||
disable_process_reply (result, error);
|
||||
return;
|
||||
@@ -630,6 +636,7 @@ mmcli_modem_run_synchronous (GDBusConnection *connection)
|
||||
if (reset_flag) {
|
||||
gboolean result;
|
||||
|
||||
g_debug ("Synchronously reseting modem...");
|
||||
result = mm_modem_reset_sync (ctx->modem, NULL, &error);
|
||||
reset_process_reply (result, error);
|
||||
return;
|
||||
@@ -639,6 +646,7 @@ mmcli_modem_run_synchronous (GDBusConnection *connection)
|
||||
if (factory_reset_str) {
|
||||
gboolean result;
|
||||
|
||||
g_debug ("Synchronously factory-reseting modem...");
|
||||
result = mm_modem_factory_reset_sync (ctx->modem,
|
||||
factory_reset_str,
|
||||
NULL,
|
||||
|
||||
Reference in New Issue
Block a user