From 5ecd17f49e427f98a8b8d4ced58a51ac9cc5381b Mon Sep 17 00:00:00 2001 From: John Keiser Date: Thu, 6 Aug 2020 13:48:58 -0700 Subject: [PATCH] Log unconsumed input as an error --- src/generic/stage2/json_iterator.h | 2 +- src/generic/stage2/logger.h | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/generic/stage2/json_iterator.h b/src/generic/stage2/json_iterator.h index 08c19818..f4cc1803 100644 --- a/src/generic/stage2/json_iterator.h +++ b/src/generic/stage2/json_iterator.h @@ -204,7 +204,7 @@ document_end: // If we didn't make it to the end, it's an error if ( !STREAMING && dom_parser.next_structural_index != dom_parser.n_structural_indexes ) { - logger::log_string("More than one JSON value at the root of the document, or extra characters at the end of the JSON!"); + log_error("More than one JSON value at the root of the document, or extra characters at the end of the JSON!"); return TAPE_ERROR; } diff --git a/src/generic/stage2/logger.h b/src/generic/stage2/logger.h index 380703a9..f2edf8e6 100644 --- a/src/generic/stage2/logger.h +++ b/src/generic/stage2/logger.h @@ -33,12 +33,6 @@ namespace logger { } } - static simdjson_really_inline void log_string(const char *message) { - if (LOG_ENABLED) { - printf("%s\n", message); - } - } - // Logs a single line of template static simdjson_really_inline void log_line(S &structurals, const char *title_prefix, const char *title, const char *detail) {