if( type == WRITE && getArg( "backend" ) == "sqlite" )
{
- L.log( m_myname + " Using same SQLite connection for reading and writing to '" + hosts[odbx_host_index[READ]] + "'", Logger::Notice );
+ g_log.log( m_myname + " Using same SQLite connection for reading and writing to '" + hosts[odbx_host_index[READ]] + "'", Logger::Notice );
m_handle[WRITE] = m_handle[READ];
return true;
}
{
if( ( err = odbx_bind( m_handle[type], getArg( "database" ).c_str(), getArg( "username" ).c_str(), getArg( "password" ).c_str(), ODBX_BIND_SIMPLE ) ) == ODBX_ERR_SUCCESS )
{
- L.log( m_myname + " Database connection (" + (type ? "write" : "read") + ") to '" + hosts[h] + "' succeeded", Logger::Notice );
+ g_log.log( m_myname + " Database connection (" + (type ? "write" : "read") + ") to '" + hosts[h] + "' succeeded", Logger::Notice );
return true;
}
- L.log( m_myname + " Unable to bind to database on host " + hosts[h] + " - " + string( odbx_error( m_handle[type], err ) ), Logger::Error );
+ g_log.log( m_myname + " Unable to bind to database on host " + hosts[h] + " - " + string( odbx_error( m_handle[type], err ) ), Logger::Error );
continue;
}
- L.log( m_myname + " Unable to connect to server on host " + hosts[h] + " - " + string( odbx_error( m_handle[type], err ) ), Logger::Error );
+ g_log.log( m_myname + " Unable to connect to server on host " + hosts[h] + " - " + string( odbx_error( m_handle[type], err ) ), Logger::Error );
}
m_handle[type] = NULL;
int err;
- DLOG( L.log( m_myname + " execStmt()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " execStmt()", Logger::Debug ) );
- if( m_qlog ) { L.log( m_myname + " Query: " + stmt, Logger::Info ); }
+ if( m_qlog ) { g_log.log( m_myname + " Query: " + stmt, Logger::Info ); }
if( ( err = odbx_query( m_handle[type], stmt, length ) ) < 0 )
{
- L.log( m_myname + " execStmt: Unable to execute query - " + string( odbx_error( m_handle[type], err ) ), Logger::Error );
+ g_log.log( m_myname + " execStmt: Unable to execute query - " + string( odbx_error( m_handle[type], err ) ), Logger::Error );
if( err != -ODBX_ERR_PARAM && odbx_error_type( m_handle[type], err ) > 0 ) { return false; } // ODBX_ERR_PARAM workaround
if( !connectTo( m_hosts[type], type ) ) { return false; }
int err = 3;
- DLOG( L.log( m_myname + " getRecord()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " getRecord()", Logger::Debug ) );
do
{
if( err < 0 )
{
- L.log( m_myname + " getRecord: Unable to get next result - " + string( odbx_error( m_handle[type], err ) ), Logger::Error );
+ g_log.log( m_myname + " getRecord: Unable to get next result - " + string( odbx_error( m_handle[type], err ) ), Logger::Error );
throw( PDNSException( "Error: odbx_result() failed" ) );
}
{
if( ( err = odbx_row_fetch( m_result ) ) < 0 )
{
- L.log( m_myname + " getRecord: Unable to get next row - " + string( odbx_error( m_handle[type], err ) ), Logger::Error );
+ g_log.log( m_myname + " getRecord: Unable to get next row - " + string( odbx_error( m_handle[type], err ) ), Logger::Error );
throw( PDNSException( "Error: odbx_row_fetch() failed" ) );
}
}
}
- L.log( m_myname + " Values: " + fields, Logger::Error );
+ g_log.log( m_myname + " Values: " + fields, Logger::Error );
#endif
return true;
}
unsigned long len = sizeof( m_escbuf );
- DLOG( L.log( m_myname + " escape(string)", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " escape(string)", Logger::Debug ) );
if( ( err = odbx_escape( m_handle[type], str.c_str(), str.size(), m_escbuf, &len ) ) < 0 )
{
- L.log( m_myname + " escape(string): Unable to escape string - " + string( odbx_error( m_handle[type], err ) ), Logger::Error );
+ g_log.log( m_myname + " escape(string): Unable to escape string - " + string( odbx_error( m_handle[type], err ) ), Logger::Error );
if( err != -ODBX_ERR_PARAM && odbx_error_type( m_handle[type], err ) > 0 ) { throw( runtime_error( "odbx_escape() failed" ) ); } // ODBX_ERR_PARAM workaround
if( !connectTo( m_hosts[type], type ) ) { throw( runtime_error( "odbx_escape() failed" ) ); }
SOAData sd;
- DLOG( L.log( m_myname + " getDomainList()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " getDomainList()", Logger::Debug ) );
if( !execStmt( stmt.c_str(), stmt.size(), READ ) ) { return false; }
if( !getRecord( READ ) ) { return false; }