diff options
author | Håvard Pettersen <havardpe@oath.com> | 2021-10-14 10:04:26 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2021-10-14 13:16:12 +0000 |
commit | a57815a82d4bf248a1179210f033fb94a58e0240 (patch) | |
tree | 34c0037397d825a6c803d2cf3573c56f375e4e8e /searchsummary | |
parent | 73384b28424890ac344ea04c3efdf936b279fbc4 (diff) |
report more issues
Diffstat (limited to 'searchsummary')
5 files changed, 20 insertions, 10 deletions
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp b/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp index 36ebadaa2a2..6dd952f87ef 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp +++ b/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp @@ -14,6 +14,7 @@ #include <vespa/searchlib/tensor/i_tensor_attribute.h> #include <vespa/vespalib/data/slime/slime.h> #include <vespa/vespalib/objects/nbostream.h> +#include <vespa/vespalib/util/issue.h> #include <vespa/log/log.h> LOG_SETUP(".searchlib.docsummary.attributedfw"); @@ -27,6 +28,7 @@ using vespalib::slime::Cursor; using vespalib::slime::Inserter; using vespalib::slime::Symbol; using vespalib::eval::Value; +using vespalib::Issue; namespace search::docsummary { @@ -296,7 +298,7 @@ AttributeDFWFactory::create(IAttributeManager& attr_mgr, auto ctx = attr_mgr.createContext(); const auto* attr = ctx->getAttribute(attr_name); if (attr == nullptr) { - LOG(warning, "No valid attribute vector found: '%s'", attr_name.c_str()); + Issue::report("No valid attribute vector found: '%s'", attr_name.c_str()); return std::unique_ptr<IDocsumFieldWriter>(); } if (attr->hasMultiValue()) { diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumstate.cpp b/searchsummary/src/vespa/searchsummary/docsummary/docsumstate.cpp index 4e551078c0b..31d174c72a8 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/docsumstate.cpp +++ b/searchsummary/src/vespa/searchsummary/docsummary/docsumstate.cpp @@ -10,6 +10,7 @@ #include <vespa/searchlib/common/matching_elements.h> #include <vespa/searchlib/parsequery/parse.h> #include <vespa/searchlib/parsequery/stackdumpiterator.h> +#include <vespa/vespalib/util/issue.h> #include "docsum_field_writer_state.h" #include <vespa/log/log.h> @@ -17,6 +18,7 @@ LOG_SETUP(".searchsummary.docsummary.docsumstate"); using search::common::GeoLocationParser; using search::common::GeoLocationSpec; +using vespalib::Issue; namespace search::docsummary { @@ -92,8 +94,8 @@ GetDocsumsState::parse_locations() GeoLocationSpec spec{attr_name, parser.getGeoLocation()}; _parsedLocations.push_back(spec); } else { - LOG(warning, "could not parse location string '%s' from request", - _args.getLocation().c_str()); + Issue::report("could not parse location string '%s' from request", + _args.getLocation().c_str()); } } auto stackdump = _args.getStackDump(); @@ -109,8 +111,8 @@ GetDocsumsState::parse_locations() GeoLocationSpec spec{attr_name, parser.getGeoLocation()}; _parsedLocations.push_back(spec); } else { - LOG(warning, "could not parse location string '%s' from stack dump", - term.c_str()); + Issue::report("could not parse location string '%s' from stack dump", + term.c_str()); } } } diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp b/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp index 00c40baefbc..e4d56b82f5c 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp +++ b/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp @@ -7,11 +7,13 @@ #include <vespa/searchlib/util/slime_output_raw_buf_adapter.h> #include <vespa/searchlib/attribute/iattributemanager.h> #include <vespa/vespalib/data/slime/slime.h> +#include <vespa/vespalib/util/issue.h> #include <vespa/log/log.h> LOG_SETUP(".searchlib.docsummary.docsumwriter"); using namespace vespalib::slime::convenience; +using vespalib::Issue; namespace search::docsummary { @@ -46,7 +48,7 @@ DynamicDocsumWriter::resolveOutputClass(vespalib::stringref summaryClass) const if (id != ResultConfig::NoClassID()) { const ResultClass *oC = _resultConfig->LookupResultClass(id); if (oC == nullptr) { - LOG(warning, "Illegal docsum class requested: %d, using empty docsum for documents", id); + Issue::report("Illegal docsum class requested: %d, using empty docsum for documents", id); result.mustSkip = true; } else { result.outputClass = oC; diff --git a/searchsummary/src/vespa/searchsummary/docsummary/geoposdfw.cpp b/searchsummary/src/vespa/searchsummary/docsummary/geoposdfw.cpp index 35808ffdd6f..1f73872af6e 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/geoposdfw.cpp +++ b/searchsummary/src/vespa/searchsummary/docsummary/geoposdfw.cpp @@ -7,6 +7,7 @@ #include <vespa/vespalib/util/jsonwriter.h> #include <vespa/vespalib/data/slime/cursor.h> #include <vespa/vespalib/stllike/asciistream.h> +#include <vespa/vespalib/util/issue.h> #include <climits> #include <vespa/log/log.h> @@ -16,6 +17,7 @@ namespace search::docsummary { using attribute::IAttributeVector; using attribute::IAttributeContext; +using vespalib::Issue; GeoPositionDFW::GeoPositionDFW(const vespalib::string & attrName) : AttrDFW(attrName) @@ -100,7 +102,7 @@ GeoPositionDFW::create(const char *attribute_name, } const IAttributeVector *attribute = context->getAttribute(attribute_name); if (!attribute) { - LOG(warning, "create: could not get attribute '%s' from context", attribute_name); + Issue::report("GeoPositionDFW::create: could not get attribute '%s' from context", attribute_name); return ret; } } diff --git a/searchsummary/src/vespa/searchsummary/docsummary/struct_fields_resolver.cpp b/searchsummary/src/vespa/searchsummary/docsummary/struct_fields_resolver.cpp index 9caad947335..74163074973 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/struct_fields_resolver.cpp +++ b/searchsummary/src/vespa/searchsummary/docsummary/struct_fields_resolver.cpp @@ -3,6 +3,7 @@ #include "struct_fields_resolver.h" #include <vespa/searchcommon/attribute/iattributecontext.h> #include <vespa/searchlib/common/matching_elements_fields.h> +#include <vespa/vespalib/util/issue.h> #include <algorithm> #include <vespa/log/log.h> @@ -10,6 +11,7 @@ LOG_SETUP(".searchsummary.docsummary.struct_fields_resolver"); using search::attribute::CollectionType; using search::attribute::IAttributeContext; +using vespalib::Issue; namespace search::docsummary { @@ -37,7 +39,7 @@ StructFieldsResolver::StructFieldsResolver(const vespalib::string& field_name, c continue; } if (attr->getCollectionType() != CollectionType::Type::ARRAY) { - LOG(warning, "Attribute '%s' is not an array attribute", name.c_str()); + Issue::report("StructFieldsResolver: Attribute '%s' is not an array attribute", name.c_str()); _error = true; break; } @@ -65,10 +67,10 @@ StructFieldsResolver::StructFieldsResolver(const vespalib::string& field_name, c if (require_all_struct_fields_as_attribute && !_map_value_fields.empty()) { if (!_has_map_key) { - LOG(warning, "Missing key attribute '%s', have value attributes for map", _map_key_attribute.c_str()); + Issue::report("StructFieldsResolver: Missing key attribute '%s', have value attributes for map", _map_key_attribute.c_str()); _error = true; } else if (_array_fields.size() != 1u) { - LOG(warning, "Could not determine if field '%s' is array or map of struct", field_name.c_str()); + Issue::report("StructFieldsResolver: Could not determine if field '%s' is array or map of struct", field_name.c_str()); _error = true; } } |