Commit e0e1b9d8 authored by Carlos Garnacho's avatar Carlos Garnacho
Browse files

tracker-extract: Demote g_message to g_debug in extractor modules

We now don't have a log handler that redirects g_message()s anywhere,
so they get to stdout/journal. This spew is most times unnecessary to
look, so make it g_debug() so it requires G_MESSAGES_DEBUG=Tracker in
place.
parent ca071d2d
......@@ -351,19 +351,19 @@ get_gps_coordinate (ExifData *exif,
exif_entry_get_value (entry, buf, sizeof (buf) - 1);
if (buf[0] == '\0') {
g_message ("EXIF GPS coordinate information is non-existent but EXIF tag '%s' was found, "
"possible broken EXIF data?",
exif_tag_get_name (tag));
g_debug ("EXIF GPS coordinate information is non-existent but EXIF tag '%s' was found, "
"possible broken EXIF data?",
exif_tag_get_name (tag));
} else {
g_message ("EXIF GPS coordinate information is partial, "
"got EXIF tag '%s' with value '%s', "
"expected with degrees, minutes and seconds",
exif_tag_get_name (tag),
buf);
g_debug ("EXIF GPS coordinate information is partial, "
"got EXIF tag '%s' with value '%s', "
"expected with degrees, minutes and seconds",
exif_tag_get_name (tag),
buf);
}
g_message ("EXIF GPS coordinate information could not be extracted with tag '%s'",
exif_tag_get_name (tag));
g_debug ("EXIF GPS coordinate information could not be extracted with tag '%s'",
exif_tag_get_name (tag));
}
}
......
......@@ -47,7 +47,7 @@ get_img_resolution (const GFile *file,
stream = g_file_read ((GFile *)file, NULL, &error);
if (error) {
g_message ("Could not read BMP file, %s", error->message);
g_debug ("Could not read BMP file, %s", error->message);
g_clear_error (&error);
return FALSE;
}
......@@ -55,27 +55,27 @@ get_img_resolution (const GFile *file,
inputstream = G_INPUT_STREAM (stream);
if (!g_input_stream_read (inputstream, bfType, 2, NULL, &error)) {
g_message ("Could not read BMP header from stream, %s", error ? error->message : "No error given");
g_debug ("Could not read BMP header from stream, %s", error ? error->message : "No error given");
g_clear_error (&error);
g_object_unref (stream);
return FALSE;
}
if (bfType[0] != 'B' || bfType[1] != 'M') {
g_message ("Expected BMP header to read 'B' or 'M', can not continue");
g_debug ("Expected BMP header to read 'B' or 'M', can not continue");
g_object_unref (stream);
return FALSE;
}
if (!g_input_stream_skip (inputstream, 16, NULL, &error)) {
g_message ("Could not read 16 bytes from BMP header, %s", error ? error->message : "No error given");
g_debug ("Could not read 16 bytes from BMP header, %s", error ? error->message : "No error given");
g_clear_error (&error);
g_object_unref (stream);
return FALSE;
}
if (!g_input_stream_read (inputstream, &w, sizeof (uint), NULL, &error)) {
g_message ("Could not read width from BMP header, %s", error ? error->message : "No error given");
g_debug ("Could not read width from BMP header, %s", error ? error->message : "No error given");
g_clear_error (&error);
g_object_unref (stream);
return FALSE;
......
......@@ -140,7 +140,7 @@ mdvi_init_context (const char *file)
}
if ((arg = fuget1 (p)) != DVI_ID) {
g_message ("Unsupported DVI format (version %u)", arg);
g_debug ("Unsupported DVI format (version %u)", arg);
goto error;
}
......
......@@ -75,9 +75,9 @@ gif_error (const gchar *action, int err)
{
const char *str = GifErrorString (err);
if (str != NULL) {
g_message ("%s, error: '%s'", action, str);
g_debug ("%s, error: '%s'", action, str);
} else {
g_message ("%s, undefined error %d", action, err);
g_debug ("%s, undefined error %d", action, err);
}
}
#else /* GIFLIB_MAJOR >= 5 */
......@@ -86,9 +86,9 @@ static inline void print_gif_error()
#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && ((GIFLIB_MAJOR == 4 && GIFLIB_MINOR >= 2) || GIFLIB_MAJOR > 4)
const char *str = GifErrorString ();
if (str != NULL) {
g_message ("GIF, error: '%s'", str);
g_debug ("GIF, error: '%s'", str);
} else {
g_message ("GIF, undefined error");
g_debug ("GIF, undefined error");
}
#else
PrintGifError();
......
......@@ -1171,8 +1171,8 @@ discoverer_init_and_run (MetadataExtractor *extractor,
if (error) {
if (gst_discoverer_info_get_result(info) == GST_DISCOVERER_MISSING_PLUGINS) {
required_plugins_message = get_discoverer_required_plugins_message (info);
g_message ("Missing a GStreamer plugin for %s. %s", uri,
required_plugins_message);
g_debug ("Missing a GStreamer plugin for %s. %s", uri,
required_plugins_message);
g_free (required_plugins_message);
} else if (error->domain != GST_STREAM_ERROR ||
(error->code != GST_STREAM_ERROR_TYPE_NOT_FOUND &&
......
......@@ -43,9 +43,9 @@ find_max_width_and_height (const gchar *uri,
file = g_file_new_for_uri (uri);
stream = g_file_read (file, NULL, &error);
if (error) {
g_message ("Could not read file '%s': %s",
uri,
error->message);
g_debug ("Could not read file '%s': %s",
uri,
error->message);
g_error_free (error);
g_object_unref (file);
......@@ -65,8 +65,8 @@ find_max_width_and_height (const gchar *uri,
NULL,
NULL,
&error)) {
g_message ("Error reading icon header from stream: '%s'",
error->message);
g_debug ("Error reading icon header from stream: '%s'",
error->message);
g_error_free (error);
g_object_unref (stream);
g_object_unref (file);
......@@ -91,9 +91,9 @@ find_max_width_and_height (const gchar *uri,
NULL,
NULL,
&error)) {
g_message ("Error reading icon image metadata '%u' from stream: '%s'",
i,
error->message);
g_debug ("Error reading icon image metadata '%u' from stream: '%s'",
i,
error->message);
g_error_free (error);
break;
}
......
......@@ -65,8 +65,8 @@ tracker_extract_get_metadata (TrackerExtractInfo *info_)
if (error != NULL) {
if (error->code != OSINFO_MEDIA_ERROR_NOT_BOOTABLE) {
g_object_unref (metadata);
g_message ("Could not extract iso info from '%s': %s",
filename, error->message);
g_debug ("Could not extract iso info from '%s': %s",
filename, error->message);
g_free (filename);
g_error_free (error);
return FALSE;
......
......@@ -2145,7 +2145,7 @@ parse_id3v24 (const gchar *data,
/* We don't handle experimental cases */
if (experimental) {
g_message ("[v24] Experimental MP3s are not extracted, doing nothing");
g_debug ("[v24] Experimental MP3s are not extracted, doing nothing");
return;
}
......@@ -2161,7 +2161,7 @@ parse_id3v24 (const gchar *data,
* bytes, so we check that there is some content AFTER the
* headers. */
if (tsize > size - header_size) {
g_message ("[v24] Expected MP3 tag size and header size to be within file size boundaries");
g_debug ("[v24] Expected MP3 tag size and header size to be within file size boundaries");
return;
}
......@@ -2183,7 +2183,7 @@ parse_id3v24 (const gchar *data,
* the headers, in other words the padding.
*/
if (ext_header_size > size - header_size - tsize) {
g_message ("[v24] Expected MP3 tag size and extended header size to be within file size boundaries");
g_debug ("[v24] Expected MP3 tag size and extended header size to be within file size boundaries");
return;
}
......@@ -2204,10 +2204,10 @@ parse_id3v24 (const gchar *data,
* Flags $xx xx
*/
if (pos + frame_size > tsize + header_size) {
g_message ("[v24] Expected MP3 frame size (%d) to be within tag size (%d) boundaries, position = %d",
frame_size,
tsize + header_size,
pos);
g_debug ("[v24] Expected MP3 frame size (%d) to be within tag size (%d) boundaries, position = %d",
frame_size,
tsize + header_size,
pos);
break;
}
......@@ -2349,7 +2349,7 @@ parse_id3v23 (const gchar *data,
/* We don't handle experimental cases */
if (experimental) {
g_message ("[v23] Experimental MP3s are not extracted, doing nothing");
g_debug ("[v23] Experimental MP3s are not extracted, doing nothing");
return;
}
......@@ -2365,7 +2365,7 @@ parse_id3v23 (const gchar *data,
* bytes, so we check that there is some content AFTER the
* headers. */
if (tsize > size - header_size) {
g_message ("[v23] Expected MP3 tag size and header size to be within file size boundaries");
g_debug ("[v23] Expected MP3 tag size and header size to be within file size boundaries");
return;
}
......@@ -2387,7 +2387,7 @@ parse_id3v23 (const gchar *data,
* the headers, in other words the padding.
*/
if (ext_header_size > size - header_size - tsize) {
g_message ("[v23] Expected MP3 tag size and extended header size to be within file size boundaries");
g_debug ("[v23] Expected MP3 tag size and extended header size to be within file size boundaries");
return;
}
......@@ -2408,10 +2408,10 @@ parse_id3v23 (const gchar *data,
* Flags $xx xx
*/
if (pos + frame_size > tsize + header_size) {
g_message ("[v23] Expected MP3 frame size (%d) to be within tag size (%d) boundaries, position = %d",
frame_size,
tsize + header_size,
pos);
g_debug ("[v23] Expected MP3 frame size (%d) to be within tag size (%d) boundaries, position = %d",
frame_size,
tsize + header_size,
pos);
break;
}
......@@ -2528,7 +2528,7 @@ parse_id3v20 (const gchar *data,
tsize = extract_uint32_7bit (&data[6]);
if (tsize > size - header_size) {
g_message ("[v20] Expected MP3 tag size and header size to be within file size boundaries");
g_debug ("[v20] Expected MP3 tag size and header size to be within file size boundaries");
return;
}
......@@ -2542,10 +2542,10 @@ parse_id3v20 (const gchar *data,
g_assert (pos <= size - frame_size);
if (pos + frame_size > tsize + header_size) {
g_message ("[v20] Expected MP3 frame size (%d) to be within tag size (%d) boundaries, position = %d",
frame_size,
tsize + header_size,
pos);
g_debug ("[v20] Expected MP3 frame size (%d) to be within tag size (%d) boundaries, position = %d",
frame_size,
tsize + header_size,
pos);
break;
}
......
......@@ -252,7 +252,7 @@ msoffice_xml_content_parse_start (GMarkupParseContext *context,
break;
case FILE_TYPE_INVALID:
g_message ("Microsoft document type:%d invalid", info->file_type);
g_debug ("Microsoft document type:%d invalid", info->file_type);
break;
}
}
......@@ -679,9 +679,9 @@ msoffice_xml_content_types_parse_start (GMarkupParseContext *context,
/* Both part_name and content_type MUST be NON-NULL */
if (!part_name || !content_type) {
g_message ("Invalid file (part_name:%s, content_type:%s)",
part_name ? part_name : "none",
content_type ? content_type : "none");
g_debug ("Invalid file (part_name:%s, content_type:%s)",
part_name ? part_name : "none",
content_type ? content_type : "none");
return;
}
......@@ -694,8 +694,8 @@ msoffice_xml_content_types_parse_start (GMarkupParseContext *context,
/* If the file type is unknown, skip trying to extract content */
if (info->file_type == FILE_TYPE_INVALID) {
g_message ("Invalid file type, not extracting content from '%s'",
part_name + 1);
g_debug ("Invalid file type, not extracting content from '%s'",
part_name + 1);
return;
}
......@@ -762,7 +762,7 @@ msoffice_xml_get_file_type (const gchar *uri)
/* MsOffice Excel document */
file_type = FILE_TYPE_XLSX;
} else {
g_message ("Mime type was not recognised:'%s'", mime_used);
g_debug ("Mime type was not recognised:'%s'", mime_used);
file_type = FILE_TYPE_INVALID;
}
......
......@@ -1682,7 +1682,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
content = extract_excel_content (infile, max_bytes, &is_encrypted);
} else {
g_message ("Mime type was not recognised:'%s'", mime_used);
g_debug ("Mime type was not recognised:'%s'", mime_used);
}
if (content) {
......
......@@ -226,7 +226,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *extract_info)
} else if (g_ascii_strcasecmp (mime_used, "application/vnd.oasis.opendocument.graphics") == 0) {
file_type = FILE_TYPE_ODG;
} else {
g_message ("Mime type was not recognised:'%s'", mime_used);
g_debug ("Mime type was not recognised:'%s'", mime_used);
file_type = FILE_TYPE_INVALID;
}
......@@ -485,7 +485,7 @@ xml_start_element_handler_content (GMarkupParseContext *context,
return;
case FILE_TYPE_INVALID:
g_message ("Open Office Document type: %d invalid", data->file_type);
g_debug ("Open Office Document type: %d invalid", data->file_type);
push_tag (ODT_TAG_TYPE_UNKNOWN);
return;
}
......
......@@ -77,7 +77,7 @@ entry_parsed (TotemPlParser *parser,
if (data->track_counter > 1000) {
/* limit playlists to 1000 entries for query performance reasons */
g_message ("Playlist has > 1000 entries. Ignoring for performance reasons.");
g_debug ("Playlist has > 1000 entries. Ignoring for performance reasons.");
return;
}
......@@ -143,11 +143,11 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
if (totem_pl_parser_parse (pl, uri, FALSE) == TOTEM_PL_PARSER_RESULT_SUCCESS) {
if (data.title != NULL) {
g_message ("Playlist title:'%s'", data.title);
g_debug ("Playlist title:'%s'", data.title);
tracker_resource_set_string (metadata, "nie:title", data.title);
g_free (data.title);
} else {
g_message ("Playlist has no title, attempting to get one from filename");
g_debug ("Playlist has no title, attempting to get one from filename");
tracker_guarantee_resource_title_from_file (metadata, "nie:title", NULL, uri, NULL);
}
......
......@@ -118,7 +118,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
if (error != NULL) {
/* An error occurred, perhaps the file was deleted. */
g_message ("Error extracting content: %s", error->message);
g_debug ("Error extracting content: %s", error->message);
g_error_free (error);
return FALSE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment