Skip to content

Commit aaf5b9c

Browse files
author
g_j_m
committed
Move various debugging outputs to QgsLogger::debug so as to reduce
the amount of user-confusing output on the console. git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5777 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 082eb51 commit aaf5b9c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/gui/qgspgquerybuilder.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <q3listbox.h>
1818
#include <QMessageBox>
1919
#include "qgspgquerybuilder.h"
20+
#include <qgslogger.h>
2021
// default constructor
2122
QgsPgQueryBuilder::QgsPgQueryBuilder(QWidget *parent, Qt::WFlags fl)
2223
: QDialog(parent, fl)
@@ -102,7 +103,7 @@ void QgsPgQueryBuilder::populateFields()
102103
// field name, type, length, and precision (if numeric)
103104
QString sql = "select * from \"" + mUri->schema + "\".\"" + mUri->table + "\" limit 1";
104105
PGresult *result = PQexec(mPgConnection, (const char *) (sql.utf8()));
105-
qWarning(("Query executed: " + sql).toLocal8Bit().data());
106+
QgsLogger::debug("Query executed: " + sql);
106107
if (PQresultStatus(result) == PGRES_TUPLES_OK)
107108
{
108109
//--std::cout << "Field: Name, Type, Size, Modifier:" << std::endl;
@@ -111,26 +112,26 @@ void QgsPgQueryBuilder::populateFields()
111112
QString fieldName = PQfname(result, i);
112113
int fldtyp = PQftype(result, i);
113114
QString typOid = QString().setNum(fldtyp);
114-
std::cerr << "typOid is: " << typOid.toLocal8Bit().data() << std::endl;
115+
QgsLogger::debug("typOid is: " + typOid);
115116
int fieldModifier = PQfmod(result, i);
116117
QString sql = "select typelem from pg_type where typelem = " + typOid + " and typlen = -1";
117118
// //--std::cout << sql << std::endl;
118119
PGresult *oidResult = PQexec(mPgConnection,
119120
(const char *) (sql.utf8()));
120121
if (PQresultStatus(oidResult) == PGRES_TUPLES_OK)
121-
std::cerr << "Ok fetching typelem using\n" << sql.toLocal8Bit().data() << std::endl;
122+
QgsLogger::debug("Ok fetching typelem using\n" + sql);
122123

123124
// get the oid of the "real" type
124125
QString poid = QString::fromUtf8(PQgetvalue(oidResult, 0,
125126
PQfnumber(oidResult,
126127
"typelem")));
127-
std::cerr << "poid is: " << poid.toLocal8Bit().data() << std::endl;
128+
QgsLogger::debug("poid is: " + poid);
128129
PQclear(oidResult);
129130
sql = "select typname, typlen from pg_type where oid = " + poid;
130131
// //--std::cout << sql << std::endl;
131132
oidResult = PQexec(mPgConnection, (const char *) (sql.utf8()));
132133
if (PQresultStatus(oidResult) == PGRES_TUPLES_OK)
133-
std::cerr << "Ok fetching typenam,etc\n";
134+
QgsLogger::debug("Ok fetching typenam,etc\n");
134135

135136
QString fieldType = QString::fromUtf8(PQgetvalue(oidResult, 0, 0));
136137
QString fieldSize = QString::fromUtf8(PQgetvalue(oidResult, 0, 1));

0 commit comments

Comments
 (0)