Add check for Env before log

This commit is contained in:
Andrej Ocenas
2019-03-15 11:53:30 +01:00
parent 96af051cb2
commit 09b9b595b2
3 changed files with 12 additions and 3 deletions

View File

@ -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",