MCPcopy Create free account
hub / github.com/ByConity/ByConity / logException

Function logException

src/Interpreters/executeQuery.cpp:472–496  ·  view source on GitHub ↗

Log exception (with query info) into text log (not into system table).

Source from the content-addressed store, hash-verified

470
471/// Log exception (with query info) into text log (not into system table).
472static void logException(ContextPtr context, QueryLogElement & elem)
473{
474 String comment;
475 if (!elem.log_comment.empty())
476 comment = fmt::format(" (comment: {})", elem.log_comment);
477
478 if (elem.stack_trace.empty())
479 LOG_ERROR(
480 &Poco::Logger::get("executeQuery"),
481 "{} (from {}){} (in query: {})",
482 elem.exception,
483 context->getClientInfo().current_address.toString(),
484 comment,
485 joinLines(elem.query));
486 else
487 LOG_ERROR(
488 &Poco::Logger::get("executeQuery"),
489 "{} (from {}){} (in query: {})"
490 ", Stack trace (when copying this message, always include the lines below):\n\n{}",
491 elem.exception,
492 context->getClientInfo().current_address.toString(),
493 comment,
494 joinLines(elem.query),
495 elem.stack_trace);
496}
497
498static LabelledMetrics::MetricLabels markQueryProfileEventLabels(
499 ContextMutablePtr context,

Callers 3

exceptionMethod · 0.85
onExceptionBeforeStartFunction · 0.85
executeQueryImplFunction · 0.85

Calls 4

joinLinesFunction · 0.85
getFunction · 0.50
emptyMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected