From 7b8bcfb1739a0c662edf6b57fed2528898b31d02 Mon Sep 17 00:00:00 2001 From: "Jonathan A. Sternberg" Date: Tue, 26 Jul 2016 13:53:45 -0500 Subject: [PATCH] Add option to suppress logging query statements in the query executor --- influxql/query_executor.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/influxql/query_executor.go b/influxql/query_executor.go index ba1f6ec8cbe..bc9d3ebe949 100644 --- a/influxql/query_executor.go +++ b/influxql/query_executor.go @@ -66,6 +66,9 @@ type ExecutionOptions struct { // Node to execute on. NodeID uint64 + + // Quiet suppresses non-essential output from the query executor. + Quiet bool } // ExecutionContext contains state that the query is currently executing with. @@ -226,7 +229,9 @@ func (e *QueryExecutor) executeQuery(query *Query, opt ExecutionOptions, closing } // Log each normalized statement. - e.Logger.Println(stmt.String()) + if !ctx.Quiet { + e.Logger.Println(stmt.String()) + } // Send any other statements to the underlying statement executor. err = e.StatementExecutor.ExecuteStatement(stmt, ctx)