Commit 09b9b595 by Andrej Ocenas

Add check for Env before log

parent 96af051c
......@@ -3,6 +3,7 @@ package mssql
import (
"database/sql"
"fmt"
"github.com/grafana/grafana/pkg/setting"
"strconv"
_ "github.com/denisenkom/go-mssqldb"
......@@ -24,7 +25,9 @@ func newMssqlQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndpoin
if err != nil {
return nil, err
}
logger.Debug("getEngine", "connection", cnnstr)
if setting.Env == setting.DEV {
logger.Debug("getEngine", "connection", cnnstr)
}
config := tsdb.SqlQueryEndpointConfiguration{
DriverName: "mssql",
......
......@@ -3,6 +3,7 @@ package mysql
import (
"database/sql"
"fmt"
"github.com/grafana/grafana/pkg/setting"
"reflect"
"strconv"
"strings"
......@@ -44,7 +45,9 @@ func newMysqlQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndpoin
cnnstr += "&tls=" + tlsConfigString
}
logger.Debug("getEngine", "connection", cnnstr)
if setting.Env == setting.DEV {
logger.Debug("getEngine", "connection", cnnstr)
}
config := tsdb.SqlQueryEndpointConfiguration{
DriverName: "mysql",
......
......@@ -2,6 +2,7 @@ package postgres
import (
"database/sql"
"github.com/grafana/grafana/pkg/setting"
"net/url"
"strconv"
......@@ -19,7 +20,9 @@ func newPostgresQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndp
logger := log.New("tsdb.postgres")
cnnstr := generateConnectionString(datasource)
logger.Debug("getEngine", "connection", cnnstr)
if setting.Env == setting.DEV {
logger.Debug("getEngine", "connection", cnnstr)
}
config := tsdb.SqlQueryEndpointConfiguration{
DriverName: "postgres",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment