[tracker] tracker-extract: Improve console output for when extraction fails



commit e5dd641a0b140535d17430ad17590925ccf578b4
Author: Sam Thursfield <sam afuera me uk>
Date:   Thu Jun 9 13:47:07 2016 +0100

    tracker-extract: Improve console output for when extraction fails
    
    Old output:
    
        tracker_mimetype_info_get_module: assertion 'info != NULL' failed
        No metadata or extractor modules found to handle this file
    
    New output:
    
        file:///uri/of/file: No metadata or extractor modules found to handle this file
    
    The message is now also printed to stderr rather than stdout, so that
    stdout contains only the metadata itself in whatever output format the
    caller chose.

 src/tracker-extract/tracker-extract.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract.c b/src/tracker-extract/tracker-extract.c
index 04b3291..a184078 100644
--- a/src/tracker-extract/tracker-extract.c
+++ b/src/tracker-extract/tracker-extract.c
@@ -789,7 +789,9 @@ tracker_extract_get_metadata_by_cmdline (TrackerExtract *object,
        }
 
        task->mimetype_handlers = tracker_extract_module_manager_get_mimetype_handlers (task->mimetype);
-       task->cur_module = tracker_mimetype_info_get_module (task->mimetype_handlers, &task->cur_func, NULL);
+       if (task->mimetype_handlers) {
+               task->cur_module = tracker_mimetype_info_get_module (task->mimetype_handlers, 
&task->cur_func, NULL);
+       }
 
        while (task->cur_func) {
                if (!filter_module (object, task->cur_module) &&
@@ -845,7 +847,8 @@ tracker_extract_get_metadata_by_cmdline (TrackerExtract *object,
        }
 
        if (no_data_or_modules) {
-               g_print ("%s\n\n",
+               g_printerr ("%s: %s\n",
+                        uri,
                         _("No metadata or extractor modules found to handle this file"));
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]