summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-09-15 11:35:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-09-15 14:10:07 +0000
commit32e45a6f2a6b35ad72796387633b6b88ad117232 (patch)
treeafc6ceacabdae41e01c6f01c6c7f4c64e3e0c182 /connectivity
parent437377bbda0ac6b0be3c4f6fac59a4c782eecef8 (diff)
convert LogLevel constants to scoped enum
rename some variables to distinguish them from type name use enumarray for log level strings remove unused DATA member Change-Id: Id3c38b82e679b3aede5ce790735443e769d5f236 Reviewed-on: https://gerrit.libreoffice.org/28920 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/postgresql/pq_connection.cxx56
-rw-r--r--connectivity/source/drivers/postgresql/pq_connection.hxx25
-rw-r--r--connectivity/source/drivers/postgresql/pq_databasemetadata.cxx28
-rw-r--r--connectivity/source/drivers/postgresql/pq_preparedstatement.cxx2
-rw-r--r--connectivity/source/drivers/postgresql/pq_statement.cxx30
-rw-r--r--connectivity/source/drivers/postgresql/pq_updateableresultset.cxx12
-rw-r--r--connectivity/source/drivers/postgresql/pq_xcolumns.cxx4
-rw-r--r--connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx4
-rw-r--r--connectivity/source/drivers/postgresql/pq_xindexes.cxx4
-rw-r--r--connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx4
-rw-r--r--connectivity/source/drivers/postgresql/pq_xkeys.cxx4
-rw-r--r--connectivity/source/drivers/postgresql/pq_xuser.cxx4
12 files changed, 89 insertions, 88 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx
index 41f04bffffdd..89de976b0592 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.cxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.cxx
@@ -54,6 +54,7 @@
#include <rtl/strbuf.hxx>
#include <rtl/uuid.h>
#include <rtl/bootstrap.hxx>
+#include <o3tl/enumarray.hxx>
#include <osl/module.h>
#include <cppuhelper/implementationentry.hxx>
@@ -127,9 +128,9 @@ css::uno::Sequence<OUString> ConnectionGetSupportedServiceNames()
return Sequence< OUString > { "com.sun.star.sdbc.Connection" };
}
-static sal_Int32 readLogLevelFromConfiguration()
+static LogLevel readLogLevelFromConfiguration()
{
- sal_Int32 loglevel = LogLevel::NONE;
+ LogLevel nLogLevel = LogLevel::NONE;
OUString fileName;
osl_getModuleURLFromFunctionAddress(
reinterpret_cast<oslGenericFunction>(readLogLevelFromConfiguration), &fileName.pData );
@@ -144,20 +145,20 @@ static sal_Int32 readLogLevelFromConfiguration()
if( bootstrapHandle.getFrom( "PQ_LOGLEVEL", str ) )
{
if ( str == "NONE" )
- loglevel = LogLevel::NONE;
+ nLogLevel = LogLevel::NONE;
else if ( str == "ERROR" )
- loglevel = LogLevel::ERROR;
+ nLogLevel = LogLevel::Error;
else if ( str == "SQL" )
- loglevel = LogLevel::SQL;
+ nLogLevel = LogLevel::Sql;
else if ( str == "INFO" )
- loglevel = LogLevel::INFO;
+ nLogLevel = LogLevel::Info;
else
{
fprintf( stderr, "unknown loglevel %s\n",
OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr() );
}
}
- return loglevel;
+ return nLogLevel;
}
Connection::Connection(
@@ -167,15 +168,15 @@ Connection::Connection(
m_ctx( ctx ) ,
m_refMutex( refMutex )
{
- m_settings.loglevel = readLogLevelFromConfiguration();
+ m_settings.m_nLogLevel = readLogLevelFromConfiguration();
- if( m_settings.loglevel > LogLevel::NONE )
+ if (m_settings.m_nLogLevel != LogLevel::NONE)
{
m_settings.logFile = fopen( "sdbc-pqsql.log", "a" );
if( m_settings.logFile )
{
setvbuf( m_settings.logFile, nullptr, _IONBF, 0 );
- log( &m_settings, m_settings.loglevel , "set this loglevel" );
+ log(&m_settings, m_settings.m_nLogLevel , "set this loglevel");
}
else
{
@@ -211,7 +212,7 @@ void Connection::close() throw ( SQLException, RuntimeException, std::exception
// silently ignore, if the connection has been closed already
if( m_settings.pConnection )
{
- log( &m_settings, LogLevel::INFO, "closing connection" );
+ log(&m_settings, LogLevel::Info, "closing connection");
PQfinish( m_settings.pConnection );
m_settings.pConnection = nullptr;
}
@@ -592,13 +593,13 @@ void Connection::initialize( const Sequence< Any >& aArguments )
m_settings.catalog = OUString( p, strlen(p), RTL_TEXTENCODING_UTF8);
m_settings.tc = tc;
- if( isLog( &m_settings, LogLevel::INFO ) )
+ if (isLog(&m_settings, LogLevel::Info))
{
OUStringBuffer buf( 128 );
buf.append( "connection to '" );
buf.append( url );
buf.append( "' successfully opened" );
- log( &m_settings, LogLevel::INFO, buf.makeStringAndClear() );
+ log(&m_settings, LogLevel::Info, buf.makeStringAndClear());
}
}
@@ -617,9 +618,9 @@ void Connection::checkClosed() throw ( SQLException, RuntimeException )
Reference< XNameAccess > Connection::getTables()
throw (css::uno::RuntimeException, std::exception)
{
- if( isLog( &m_settings, LogLevel::INFO ) )
+ if (isLog(&m_settings, LogLevel::Info))
{
- log( &m_settings, LogLevel::INFO, "Connection::getTables() got called" );
+ log(&m_settings, LogLevel::Info, "Connection::getTables() got called");
}
MutexGuard guard( m_refMutex->mutex );
if( !m_settings.tables.is() )
@@ -633,9 +634,9 @@ Reference< XNameAccess > Connection::getTables()
Reference< XNameAccess > Connection::getViews()
throw (css::uno::RuntimeException, std::exception)
{
- if( isLog( &m_settings, LogLevel::INFO ) )
+ if (isLog(&m_settings, LogLevel::Info))
{
- log( &m_settings, LogLevel::INFO, "Connection::getViews() got called" );
+ log(&m_settings, LogLevel::Info, "Connection::getViews() got called");
}
MutexGuard guard( m_refMutex->mutex );
if( !m_settings.views.is() )
@@ -650,9 +651,9 @@ Reference< XNameAccess > Connection::getViews()
Reference< XNameAccess > Connection::getUsers()
throw (css::uno::RuntimeException, std::exception)
{
- if( isLog( &m_settings, LogLevel::INFO ) )
+ if (isLog(&m_settings, LogLevel::Info))
{
- log( &m_settings, LogLevel::INFO, "Connection::getUsers() got called" );
+ log(&m_settings, LogLevel::Info, "Connection::getUsers() got called");
}
MutexGuard guard( m_refMutex->mutex );
@@ -670,20 +671,21 @@ Reference< XInterface > ConnectionCreateInstance(
}
-bool isLog( ConnectionSettings *settings, int loglevel )
+bool isLog(ConnectionSettings *settings, LogLevel nLevel)
{
- return settings->loglevel >= loglevel && settings->logFile;
+ return static_cast<int>(settings->m_nLogLevel) >= static_cast<int>(nLevel)
+ && settings->logFile;
}
-void log( ConnectionSettings *settings, sal_Int32 level, const OUString &logString )
+void log(ConnectionSettings *settings, LogLevel nLevel, const OUString &logString)
{
- log( settings, level, OUStringToOString( logString, settings->encoding ).getStr() );
+ log(settings, nLevel, OUStringToOString(logString, settings->encoding ).getStr());
}
-void log( ConnectionSettings *settings, sal_Int32 level, const char *str )
+void log(ConnectionSettings *settings, LogLevel nLevel, const char *str)
{
- if( isLog( settings, level ) )
+ if (isLog(settings, nLevel))
{
- static const char *strLevel[] = { "NONE", "ERROR", "SQL", "INFO", "DATA" };
+ static const o3tl::enumarray<LogLevel, const char*> strLevel = {"NONE", "ERROR", "SQL", "INFO"};
time_t t = ::time( nullptr );
char *pString;
@@ -705,7 +707,7 @@ void log( ConnectionSettings *settings, sal_Int32 level, const char *str )
break;
}
}
- fprintf( settings->logFile, "%s [%s]: %s\n", pString, strLevel[level], str );
+ fprintf(settings->logFile, "%s [%s]: %s\n", pString, strLevel[nLevel], str);
}
}
diff --git a/connectivity/source/drivers/postgresql/pq_connection.hxx b/connectivity/source/drivers/postgresql/pq_connection.hxx
index 4459a24c0d87..f4c24ed9f5fd 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.hxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.hxx
@@ -80,18 +80,17 @@ struct ConnectionSettings;
// Logging API
-namespace LogLevel
+enum class LogLevel
{
-// when you add a loglevel, extend the log function !
-static const sal_Int32 NONE = 0;
-static const sal_Int32 ERROR = 1;
-static const sal_Int32 SQL = 2;
-static const sal_Int32 INFO = 3;
-static const sal_Int32 DATA = 4;
-}
-bool isLog( ConnectionSettings *settings, int loglevel );
-void log( ConnectionSettings *settings, sal_Int32 level, const OUString &logString );
-void log( ConnectionSettings *settings, sal_Int32 level, const char *str );
+ NONE = 0,
+ Error,
+ Sql,
+ Info,
+ LAST = Info
+};
+bool isLog(ConnectionSettings *settings, LogLevel nLevel);
+void log(ConnectionSettings *settings, LogLevel nLevel, const OUString &logString);
+void log(ConnectionSettings *settings, LogLevel nLevel, const char *str);
class Tables;
@@ -107,7 +106,7 @@ struct ConnectionSettings
pViewsImpl(nullptr),
showSystemColumns( false ),
logFile( nullptr ),
- loglevel( LogLevel::INFO )
+ m_nLogLevel(LogLevel::Info)
{}
rtl_TextEncoding encoding;
PGconn *pConnection;
@@ -123,7 +122,7 @@ struct ConnectionSettings
OUString catalog;
bool showSystemColumns;
FILE *logFile;
- sal_Int32 loglevel;
+ LogLevel m_nLogLevel;
};
diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
index 4fc38e722a7c..c25edcd47787 100644
--- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
+++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
@@ -1131,14 +1131,14 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTables(
MutexGuard guard( m_refMutex->mutex );
- if( isLog( m_pSettings, LogLevel::INFO ) )
+ if (isLog(m_pSettings, LogLevel::Info))
{
OUStringBuffer buf( 128 );
buf.append( "DatabaseMetaData::getTables got called with " );
buf.append( schemaPattern );
buf.append( "." );
buf.append( tableNamePattern );
- log( m_pSettings, LogLevel::INFO, buf.makeStringAndClear() );
+ log(m_pSettings, LogLevel::Info, buf.makeStringAndClear());
}
// ignore catalog, as a single pq connection does not support multiple catalogs
@@ -1263,9 +1263,9 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getSchemas( )
{
MutexGuard guard( m_refMutex->mutex );
- if( isLog( m_pSettings, LogLevel::INFO ) )
+ if (isLog(m_pSettings, LogLevel::Info))
{
- log( m_pSettings, LogLevel::INFO, "DatabaseMetaData::getSchemas() got called" );
+ log(m_pSettings, LogLevel::Info, "DatabaseMetaData::getSchemas() got called");
}
// <b>TABLE_SCHEM</b> string =&amp;gt; schema name
Reference< XStatement > statement = m_origin->createStatement();
@@ -1469,7 +1469,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getColumns(
// continue !
MutexGuard guard( m_refMutex->mutex );
- if( isLog( m_pSettings, LogLevel::INFO ) )
+ if (isLog(m_pSettings, LogLevel::Info))
{
OUStringBuffer buf( 128 );
buf.append( "DatabaseMetaData::getColumns got called with " );
@@ -1478,7 +1478,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getColumns(
buf.append( tableNamePattern );
buf.append( "." );
buf.append( columnNamePattern );
- log( m_pSettings, LogLevel::INFO, buf.makeStringAndClear() );
+ log(m_pSettings, LogLevel::Info, buf.makeStringAndClear());
}
// ignore catalog, as a single pq connection
@@ -1652,7 +1652,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getColumnPrivileges(
MutexGuard guard( m_refMutex->mutex );
- if( isLog( m_pSettings, LogLevel::INFO ) )
+ if (isLog(m_pSettings, LogLevel::Info))
{
OUStringBuffer buf( 128 );
buf.append( "DatabaseMetaData::getColumnPrivileges got called with " );
@@ -1661,7 +1661,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getColumnPrivileges(
buf.append( table );
buf.append( "." );
buf.append( columnNamePattern );
- log( m_pSettings, LogLevel::INFO, buf.makeStringAndClear() );
+ log(m_pSettings, LogLevel::Info, buf.makeStringAndClear());
}
Reference< XParameters > parameters( m_getColumnPrivs_stmt, UNO_QUERY_THROW );
@@ -1681,14 +1681,14 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTablePrivileges(
{
MutexGuard guard( m_refMutex->mutex );
- if( isLog( m_pSettings, LogLevel::INFO ) )
+ if (isLog(m_pSettings, LogLevel::Info))
{
OUStringBuffer buf( 128 );
buf.append( "DatabaseMetaData::getTablePrivileges got called with " );
buf.append( schemaPattern );
buf.append( "." );
buf.append( tableNamePattern );
- log( m_pSettings, LogLevel::INFO, buf.makeStringAndClear() );
+ log(m_pSettings, LogLevel::Info, buf.makeStringAndClear());
}
Reference< XParameters > parameters( m_getTablePrivs_stmt, UNO_QUERY_THROW );
@@ -1739,14 +1739,14 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getPrimaryKeys(
// 5. KEY_SEQ short =&gt; sequence number within primary key
// 6. PK_NAME string =&gt; primary key name (may be NULL )
- if( isLog( m_pSettings, LogLevel::INFO ) )
+ if (isLog(m_pSettings, LogLevel::Info))
{
OUStringBuffer buf( 128 );
buf.append( "DatabaseMetaData::getPrimaryKeys got called with " );
buf.append( schema );
buf.append( "." );
buf.append( table );
- log( m_pSettings, LogLevel::INFO, buf.makeStringAndClear() );
+ log(m_pSettings, LogLevel::Info, buf.makeStringAndClear());
}
Reference< XPreparedStatement > statement = m_origin->prepareStatement(
@@ -2331,9 +2331,9 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTypeInfo( )
// Note: Indexes start at 0 (in the API doc, they start at 1)
MutexGuard guard( m_refMutex->mutex );
- if( isLog( m_pSettings, LogLevel::INFO ) )
+ if (isLog(m_pSettings, LogLevel::Info))
{
- log( m_pSettings, LogLevel::INFO, "DatabaseMetaData::getTypeInfo() got called" );
+ log(m_pSettings, LogLevel::Info, "DatabaseMetaData::getTypeInfo() got called");
}
Reference< XStatement > statement = m_origin->createStatement();
diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
index c5bbd045433b..860ffe4324da 100644
--- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
@@ -292,7 +292,7 @@ void PreparedStatement::raiseSQLException( const char * errorMsg )
buf.appendAscii( m_executedStatement.getStr() );
buf.append( "')" );
OUString error = buf.makeStringAndClear();
- log( m_pSettings, LogLevel::ERROR, error );
+ log(m_pSettings, LogLevel::Error, error);
throw SQLException( error, *this, OUString(), 1, Any() );
}
diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx
index b1297ef1a7f6..f6394fd6b27c 100644
--- a/connectivity/source/drivers/postgresql/pq_statement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_statement.cxx
@@ -248,7 +248,7 @@ void Statement::raiseSQLException(
buf.append( sql );
buf.append( "')" );
OUString error = buf.makeStringAndClear();
- log( m_pSettings, LogLevel::ERROR, error );
+ log(m_pSettings, LogLevel::Error, error);
throw SQLException( error, *this, OUString(), 1, Any() );
}
@@ -299,7 +299,7 @@ static void raiseSQLException(
buf.append( OStringToOUString( sql, pSettings->encoding ) );
buf.append( "')" );
OUString error = buf.makeStringAndClear();
- log( pSettings, LogLevel::ERROR, error );
+ log(pSettings, LogLevel::Error, error);
throw SQLException( error, owner, OUString(), 1, Any() );
}
@@ -347,13 +347,13 @@ static std::vector< OUString > lookupKeys(
// is ambigous, as I don't know postgresql searchpath,
// I can't continue here, as I may write to a different table
keySupplier.clear();
- if( isLog( pSettings, LogLevel::INFO ) )
+ if (isLog(pSettings, LogLevel::Info))
{
OStringBuffer buf( 128 );
buf.append( "Can't offer updateable result set because table " );
buf.append( OUStringToOString(name, pSettings->encoding) );
buf.append( " is duplicated, add schema to resolve ambiguity" );
- log( pSettings, LogLevel::INFO, buf.makeStringAndClear().getStr() );
+ log(pSettings, LogLevel::Info, buf.makeStringAndClear().getStr());
}
break;
}
@@ -364,13 +364,13 @@ static std::vector< OUString > lookupKeys(
}
else
{
- if( isLog( pSettings, LogLevel::INFO ) )
+ if (isLog(pSettings, LogLevel::Info))
{
OStringBuffer buf( 128 );
buf.append( "Can't offer updateable result set ( table " );
buf.append( OUStringToOString(table, pSettings->encoding) );
buf.append( " is unknown)" );
- log( pSettings, LogLevel::INFO, buf.makeStringAndClear().getStr() );
+ log(pSettings, LogLevel::Info, buf.makeStringAndClear().getStr());
}
}
@@ -411,13 +411,13 @@ static std::vector< OUString > lookupKeys(
}
if( ! ret.size() )
{
- if( isLog( pSettings, LogLevel::INFO ) )
+ if (isLog(pSettings, LogLevel::Info))
{
OStringBuffer buf( 128 );
buf.append( "Can't offer updateable result set ( table " );
buf.append( OUStringToOString(table, pSettings->encoding) );
buf.append( " does not have a primary key)" );
- log( pSettings, LogLevel::INFO, buf.makeStringAndClear().getStr() );
+ log(pSettings, LogLevel::Info, buf.makeStringAndClear().getStr());
}
}
}
@@ -455,7 +455,7 @@ bool executePostgresCommand( const OString & cmd, struct CommandData *data )
// otherwise the table name is empty
*(data->pLastTableInserted) =
extractTableFromInsert( OStringToOUString( cmd, pSettings->encoding ) );
- if( isLog( pSettings, LogLevel::SQL ) )
+ if (isLog(pSettings, LogLevel::Sql))
{
OStringBuffer buf( 128 );
buf.append( "executed command '" );
@@ -474,7 +474,7 @@ bool executePostgresCommand( const OString & cmd, struct CommandData *data )
buf.append(
OUStringToOString( *data->pLastTableInserted, pSettings->encoding ) );
}
- log( pSettings, LogLevel::SQL, buf.makeStringAndClear().getStr() );
+ log(pSettings, LogLevel::Sql, buf.makeStringAndClear().getStr());
}
PQclear( result );
break;
@@ -565,13 +565,13 @@ bool executePostgresCommand( const OString & cmd, struct CommandData *data )
buf.append( "can't support updateable result for selects with multiple tables (" );
buf.append( cmd );
buf.append( ")" );
- log( pSettings, LogLevel::SQL, buf.makeStringAndClear().getStr() );
+ log(pSettings, LogLevel::Sql, buf.makeStringAndClear().getStr() );
}
if( ! (*(data->pLastResultset)).is() )
{
- if( isLog( pSettings, LogLevel::ERROR ) )
+ if (isLog( pSettings, LogLevel::Error))
{
- log( pSettings, LogLevel::ERROR, aReason.getStr());
+ log(pSettings, LogLevel::Error, aReason.getStr());
}
// TODO: How to react here correctly ?
@@ -598,7 +598,7 @@ bool executePostgresCommand( const OString & cmd, struct CommandData *data )
data->ppSettings,result, schema, table ) );
*(data->pMultipleResultAvailable) = true;
ret = true;
- if( isLog( pSettings, LogLevel::SQL ) )
+ if (isLog(pSettings, LogLevel::Sql))
{
OStringBuffer buf( 128 );
buf.append( "executed query '" );
@@ -609,7 +609,7 @@ bool executePostgresCommand( const OString & cmd, struct CommandData *data )
buf.append( "ms, returnedRows=" );
buf.append( returnedRows );
buf.append( "." );
- log( pSettings, LogLevel::SQL, buf.makeStringAndClear().getStr() );
+ log(pSettings, LogLevel::Sql, buf.makeStringAndClear().getStr());
}
break;
}
diff --git a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx
index 6a9e2d83e26c..ca28001d07c1 100644
--- a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx
@@ -198,9 +198,9 @@ OUString UpdateableResultSet::buildWhereClause()
void UpdateableResultSet::insertRow( ) throw (SQLException, RuntimeException, std::exception)
{
MutexGuard guard( m_refMutex->mutex );
- if( isLog( *m_ppSettings, LogLevel::INFO ) )
+ if (isLog(*m_ppSettings, LogLevel::Info))
{
- log( *m_ppSettings, LogLevel::INFO,"UpdateableResultSet::insertRow got called" );
+ log(*m_ppSettings, LogLevel::Info, "UpdateableResultSet::insertRow got called");
}
if( ! m_insertRow )
throw SQLException(
@@ -292,9 +292,9 @@ void UpdateableResultSet::insertRow( ) throw (SQLException, RuntimeException, s
void UpdateableResultSet::updateRow( ) throw (SQLException, RuntimeException, std::exception)
{
MutexGuard guard( m_refMutex->mutex );
- if( isLog( *m_ppSettings, LogLevel::INFO ) )
+ if (isLog(*m_ppSettings, LogLevel::Info))
{
- log( *m_ppSettings, LogLevel::INFO,"UpdateableResultSet::updateRow got called" );
+ log(*m_ppSettings, LogLevel::Info, "UpdateableResultSet::updateRow got called");
}
if( m_insertRow )
throw SQLException(
@@ -341,9 +341,9 @@ void UpdateableResultSet::updateRow( ) throw (SQLException, RuntimeException, s
void UpdateableResultSet::deleteRow( ) throw (SQLException, RuntimeException, std::exception)
{
- if( isLog( *m_ppSettings, LogLevel::INFO ) )
+ if (isLog(*m_ppSettings, LogLevel::Info))
{
- log( *m_ppSettings, LogLevel::INFO,"UpdateableResultSet::deleteRow got called" );
+ log(*m_ppSettings, LogLevel::Info, "UpdateableResultSet::deleteRow got called");
}
if( m_insertRow )
throw SQLException(
diff --git a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
index bddd974f6b26..512554a53ad7 100644
--- a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
@@ -280,14 +280,14 @@ void Columns::refresh()
{
try
{
- if( isLog( m_pSettings, LogLevel::INFO ) )
+ if (isLog(m_pSettings, LogLevel::Info))
{
OStringBuffer buf;
buf.append( "sdbcx.Columns get refreshed for table " );
buf.append( OUStringToOString( m_schemaName, m_pSettings->encoding ) );
buf.append( "." );
buf.append( OUStringToOString( m_tableName, m_pSettings->encoding ) );
- log( m_pSettings, LogLevel::INFO, buf.makeStringAndClear().getStr() );
+ log(m_pSettings, LogLevel::Info, buf.makeStringAndClear().getStr());
}
osl::MutexGuard guard( m_refMutex->mutex );
diff --git a/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx
index 74e2d58ca263..5446e5da2132 100644
--- a/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx
@@ -105,12 +105,12 @@ void IndexColumns::refresh()
{
try
{
- if( isLog( m_pSettings, LogLevel::INFO ) )
+ if (isLog(m_pSettings, LogLevel::Info))
{
OStringBuffer buf;
buf.append( "sdbcx.IndexColumns get refreshed for index " );
buf.append( OUStringToOString( m_indexName, m_pSettings->encoding ) );
- log( m_pSettings, LogLevel::INFO, buf.makeStringAndClear().getStr() );
+ log(m_pSettings, LogLevel::Info, buf.makeStringAndClear().getStr());
}
osl::MutexGuard guard( m_refMutex->mutex );
diff --git a/connectivity/source/drivers/postgresql/pq_xindexes.cxx b/connectivity/source/drivers/postgresql/pq_xindexes.cxx
index 53766136a3ce..cb46da6fb30a 100644
--- a/connectivity/source/drivers/postgresql/pq_xindexes.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xindexes.cxx
@@ -94,14 +94,14 @@ void Indexes::refresh()
{
try
{
- if( isLog( m_pSettings, LogLevel::INFO ) )
+ if (isLog(m_pSettings, LogLevel::Info))
{
OStringBuffer buf;
buf.append( "sdbcx.Indexes get refreshed for table " );
buf.append( OUStringToOString( m_schemaName, m_pSettings->encoding ) );
buf.append( "." );
buf.append( OUStringToOString( m_tableName,m_pSettings->encoding ) );
- log( m_pSettings, LogLevel::INFO, buf.makeStringAndClear().getStr() );
+ log(m_pSettings, LogLevel::Info, buf.makeStringAndClear().getStr());
}
osl::MutexGuard guard( m_refMutex->mutex );
diff --git a/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx b/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx
index 4812758d3e08..75ee394352fa 100644
--- a/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx
@@ -91,14 +91,14 @@ void KeyColumns::refresh()
{
try
{
- if( isLog( m_pSettings, LogLevel::INFO ) )
+ if (isLog(m_pSettings, LogLevel::Info))
{
OStringBuffer buf;
buf.append( "sdbcx.KeyColumns get refreshed for table " );
buf.append( OUStringToOString( m_schemaName, m_pSettings->encoding ) );
buf.append( "." );
buf.append( OUStringToOString( m_tableName, m_pSettings->encoding ) );
- log( m_pSettings, LogLevel::INFO, buf.makeStringAndClear().getStr() );
+ log(m_pSettings, LogLevel::Info, buf.makeStringAndClear().getStr());
}
osl::MutexGuard guard( m_refMutex->mutex );
diff --git a/connectivity/source/drivers/postgresql/pq_xkeys.cxx b/connectivity/source/drivers/postgresql/pq_xkeys.cxx
index 7d5979eb75a7..f1d5de67dafe 100644
--- a/connectivity/source/drivers/postgresql/pq_xkeys.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xkeys.cxx
@@ -110,12 +110,12 @@ void Keys::refresh()
{
try
{
- if( isLog( m_pSettings, LogLevel::INFO ) )
+ if (isLog(m_pSettings, LogLevel::Info))
{
OString buf( "sdbcx.Keys get refreshed for table " +
OUStringToOString( m_schemaName, m_pSettings->encoding ) +
"." + OUStringToOString( m_tableName,m_pSettings->encoding ));
- log( m_pSettings, LogLevel::INFO, buf.getStr() );
+ log(m_pSettings, LogLevel::Info, buf.getStr());
}
osl::MutexGuard guard( m_refMutex->mutex );
diff --git a/connectivity/source/drivers/postgresql/pq_xuser.cxx b/connectivity/source/drivers/postgresql/pq_xuser.cxx
index ca0b7433b17f..6b32bd667e72 100644
--- a/connectivity/source/drivers/postgresql/pq_xuser.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xuser.cxx
@@ -137,7 +137,7 @@ sal_Int32 User::getPrivileges( const OUString& objName, sal_Int32 objType )
throw (css::sdbc::SQLException, css::uno::RuntimeException, std::exception)
{
sal_Int32 ret = 0xffffffff;
- if( isLog( m_pSettings, LogLevel::INFO ) )
+ if (isLog(m_pSettings, LogLevel::Info))
{
Statics & st = getStatics();
@@ -145,7 +145,7 @@ sal_Int32 User::getPrivileges( const OUString& objName, sal_Int32 objType )
buf.append( "User::getPrivileges[" + extractStringProperty( this, st.NAME ) +
"] got called for " + objName + "(type=" +
OUString::number(objType) + ")");
- log( m_pSettings, LogLevel::INFO, buf.makeStringAndClear() );
+ log(m_pSettings, LogLevel::Info, buf.makeStringAndClear());
}
// all privileges
return ret;