Skip to content

Commit 5ecd17f

Browse files
committed
Log unconsumed input as an error
1 parent 6bb99ae commit 5ecd17f

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

src/generic/stage2/json_iterator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code json_iterator::walk_docum
204204

205205
// If we didn't make it to the end, it's an error
206206
if ( !STREAMING && dom_parser.next_structural_index != dom_parser.n_structural_indexes ) {
207-
logger::log_string("More than one JSON value at the root of the document, or extra characters at the end of the JSON!");
207+
log_error("More than one JSON value at the root of the document, or extra characters at the end of the JSON!");
208208
return TAPE_ERROR;
209209
}
210210

src/generic/stage2/logger.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ namespace logger {
3333
}
3434
}
3535

36-
static simdjson_really_inline void log_string(const char *message) {
37-
if (LOG_ENABLED) {
38-
printf("%s\n", message);
39-
}
40-
}
41-
4236
// Logs a single line of
4337
template<typename S>
4438
static simdjson_really_inline void log_line(S &structurals, const char *title_prefix, const char *title, const char *detail) {

0 commit comments

Comments
 (0)