Indexing: print message number in case of failure

This commit is contained in:
Shahram Najm 2022-03-17 22:21:33 +00:00
parent f0c8a2cf26
commit 1db1c0831c
3 changed files with 4 additions and 3 deletions

View File

@ -1168,7 +1168,8 @@ int _codes_index_add_file(grib_index* index, const char* filename, int message_t
return err;
}
if (err && err != GRIB_NOT_FOUND) {
grib_context_log(c, GRIB_LOG_ERROR, "unable to create index. \"%s\": %s", index_key->name, grib_get_error_message(err));
grib_context_log(c, GRIB_LOG_ERROR, "unable to create index. key=\"%s\" (message #%lu): %s",
index_key->name, message_count, grib_get_error_message(err));
return err;
}

View File

@ -151,7 +151,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
printf(" }\n");
the_keys = the_keys->next;
}
printf("--- %d messages indexed\n", idx->count);
printf("--- %d message(s) indexed\n", idx->count);
if (idx->count)
grib_index_write(idx, options->outfile->name);

View File

@ -148,7 +148,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
printf(" }\n");
the_keys = the_keys->next;
}
printf("--- %d messages indexed\n", idx->count);
printf("--- %d message(s) indexed\n", idx->count);
if (idx->count)
grib_index_write(idx, options->outfile->name);