if( getArg( "host" ).size() > 0 )
{
- L.log( m_myname + " WARNING: Using deprecated opendbx-host parameter", Logger::Warning );
+ g_log.log( m_myname + " WARNING: Using deprecated opendbx-host parameter", Logger::Warning );
stringtok( m_hosts[READ], getArg( "host" ), ", " );
m_hosts[WRITE] = m_hosts[READ];
}
}
catch( std::exception& e )
{
- L.log( m_myname + " OdbxBackend(): Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " OdbxBackend(): Caught STL exception - " + e.what(), Logger::Error );
throw( PDNSException( "Fatal: STL exception" ) );
}
}
try
{
- DLOG( L.log( m_myname + " getDomainInfo()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " getDomainInfo()", Logger::Debug ) );
string stmt = getArg( "sql-zoneinfo" );
string& stmtref = strbind( ":name", escape( domain.makeLowerCase().toStringRootDot(), READ ), stmt );
}
catch( std::exception& e )
{
- L.log( m_myname + " getDomainInfo: Caught STL std::exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " getDomainInfo: Caught STL std::exception - " + e.what(), Logger::Error );
return false;
}
try
{
- DLOG( L.log( m_myname + " getSOA()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " getSOA()", Logger::Debug ) );
string stmt = getArg( "sql-lookupsoa" );
string& stmtref = strbind( ":name", escape( domain.makeLowerCase().toStringRootDot(), READ ), stmt );
}
catch( std::exception& e )
{
- L.log( m_myname + " getSOA: Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " getSOA: Caught STL exception - " + e.what(), Logger::Error );
return false;
}
{
try
{
- DLOG( L.log( m_myname + " list()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " list()", Logger::Debug ) );
m_qname.clear();
m_result = NULL;
if( len < 0 )
{
- L.log( m_myname + " list: Unable to convert zone id to string - format error", Logger::Error );
+ g_log.log( m_myname + " list: Unable to convert zone id to string - format error", Logger::Error );
return false;
}
if( len > static_cast<int>(sizeof( m_buffer )) - 1 )
{
- L.log( m_myname + " list: Unable to convert zone id to string - insufficient buffer space", Logger::Error );
+ g_log.log( m_myname + " list: Unable to convert zone id to string - insufficient buffer space", Logger::Error );
return false;
}
}
catch( std::exception& e )
{
- L.log( m_myname + " list: Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " list: Caught STL exception - " + e.what(), Logger::Error );
return false;
}
{
try
{
- DLOG( L.log( m_myname + " lookup()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " lookup()", Logger::Debug ) );
string stmt;
string& stmtref = stmt;
if( len < 0 )
{
- L.log( m_myname + " lookup: Unable to convert zone id to string - format error", Logger::Error );
+ g_log.log( m_myname + " lookup: Unable to convert zone id to string - format error", Logger::Error );
throw( DBException( "Error: Libc error" ) );
}
if( len > static_cast<int>(sizeof( m_buffer )) - 1 )
{
- L.log( m_myname + " lookup: Unable to convert zone id to string - insufficient buffer space", Logger::Error );
+ g_log.log( m_myname + " lookup: Unable to convert zone id to string - insufficient buffer space", Logger::Error );
throw( DBException( "Error: Libc error" ) );
}
}
catch( std::exception& e )
{
- L.log( m_myname + " lookup: Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " lookup: Caught STL exception - " + e.what(), Logger::Error );
throw( DBException( "Error: STL exception" ) );
}
}
try
{
- DLOG( L.log( m_myname + " get()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " get()", Logger::Debug ) );
if( getRecord( READ ) )
{
}
catch( std::exception& e )
{
- L.log( m_myname + " get: Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " get: Caught STL exception - " + e.what(), Logger::Error );
return false;
}
try
{
- DLOG( L.log( m_myname + " setFresh()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " setFresh()", Logger::Debug ) );
if( !m_handle[WRITE] && !connectTo( m_hosts[WRITE], WRITE ) )
{
- L.log( m_myname + " setFresh: Master server is unreachable", Logger::Error );
+ g_log.log( m_myname + " setFresh: Master server is unreachable", Logger::Error );
throw( DBException( "Error: Server unreachable" ) );
}
if( len < 0 )
{
- L.log( m_myname + " setFresh: Unable to insert values into statement '" + getArg( "sql-update-lastcheck" ) + "' - format error", Logger::Error );
+ g_log.log( m_myname + " setFresh: Unable to insert values into statement '" + getArg( "sql-update-lastcheck" ) + "' - format error", Logger::Error );
throw( DBException( "Error: Libc error" ) );
}
if( len > static_cast<int>(sizeof( m_buffer )) - 1 )
{
- L.log( m_myname + " setFresh: Unable to insert values into statement '" + getArg( "sql-update-lastcheck" ) + "' - insufficient buffer space", Logger::Error );
+ g_log.log( m_myname + " setFresh: Unable to insert values into statement '" + getArg( "sql-update-lastcheck" ) + "' - insufficient buffer space", Logger::Error );
throw( DBException( "Error: Libc error" ) );
}
}
catch ( std::exception& e )
{
- L.log( m_myname + " setFresh: Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " setFresh: Caught STL exception - " + e.what(), Logger::Error );
throw( DBException( "Error: STL exception" ) );
}
}
{
try
{
- DLOG( L.log( m_myname + " setNotified()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " setNotified()", Logger::Debug ) );
if( !m_handle[WRITE] && !connectTo( m_hosts[WRITE], WRITE ) )
{
- L.log( m_myname + " setFresh: Master server is unreachable", Logger::Error );
+ g_log.log( m_myname + " setFresh: Master server is unreachable", Logger::Error );
throw( DBException( "Error: Server unreachable" ) );
}
if( len < 0 )
{
- L.log( m_myname + " setNotified: Unable to insert values into statement '" + getArg( "sql-update-serial" ) + "' - format error", Logger::Error );
+ g_log.log( m_myname + " setNotified: Unable to insert values into statement '" + getArg( "sql-update-serial" ) + "' - format error", Logger::Error );
throw( DBException( "Error: Libc error" ) );
}
if( len > static_cast<int>(sizeof( m_buffer )) - 1 )
{
- L.log( m_myname + " setNotified: Unable to insert values into statement '" + getArg( "sql-update-serial" ) + "' - insufficient buffer space", Logger::Error );
+ g_log.log( m_myname + " setNotified: Unable to insert values into statement '" + getArg( "sql-update-serial" ) + "' - insufficient buffer space", Logger::Error );
throw( DBException( "Error: Libc error" ) );
}
}
catch ( std::exception& e )
{
- L.log( m_myname + " setNotified: Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " setNotified: Caught STL exception - " + e.what(), Logger::Error );
throw( DBException( "Error: STL exception" ) );
}
}
{
try
{
- DLOG( L.log( m_myname + " isMaster()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " isMaster()", Logger::Debug ) );
string stmt = getArg( "sql-master" );
string& stmtref = strbind( ":name", escape( domain.makeLowerCase().toStringRootDot(), READ ), stmt );
}
catch ( std::exception& e )
{
- L.log( m_myname + " isMaster: Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " isMaster: Caught STL exception - " + e.what(), Logger::Error );
return false;
}
{
try
{
- DLOG( L.log( m_myname + " getUnfreshSlaveInfos()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " getUnfreshSlaveInfos()", Logger::Debug ) );
if( unfresh == NULL )
{
- L.log( m_myname + " getUnfreshSlaveInfos: invalid parameter - NULL pointer", Logger::Error );
+ g_log.log( m_myname + " getUnfreshSlaveInfos: invalid parameter - NULL pointer", Logger::Error );
return;
}
}
catch ( std::exception& e )
{
- L.log( m_myname + " getUnfreshSlaveInfo: Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " getUnfreshSlaveInfo: Caught STL exception - " + e.what(), Logger::Error );
}
}
{
try
{
- DLOG( L.log( m_myname + " getUpdatedMasters()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " getUpdatedMasters()", Logger::Debug ) );
if( updated == NULL )
{
- L.log( m_myname + " getUpdatedMasters: invalid parameter - NULL pointer", Logger::Error );
+ g_log.log( m_myname + " getUpdatedMasters: invalid parameter - NULL pointer", Logger::Error );
return;
}
}
catch ( std::exception& e )
{
- L.log( m_myname + " getUpdatedMasters: Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " getUpdatedMasters: Caught STL exception - " + e.what(), Logger::Error );
}
}
{
try
{
- DLOG( L.log( m_myname + " superMasterBackend()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " superMasterBackend()", Logger::Debug ) );
if( account != NULL && ddb != NULL )
{
}
catch ( std::exception& e )
{
- L.log( m_myname + " superMasterBackend: Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " superMasterBackend: Caught STL exception - " + e.what(), Logger::Error );
return false;
}
{
try
{
- DLOG( L.log( m_myname + " createSlaveDomain()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " createSlaveDomain()", Logger::Debug ) );
if( !m_handle[WRITE] && !connectTo( m_hosts[WRITE], WRITE ) )
{
- L.log( m_myname + " createSlaveDomain: Master server is unreachable", Logger::Error );
+ g_log.log( m_myname + " createSlaveDomain: Master server is unreachable", Logger::Error );
return false;
}
if( len < 0 )
{
- L.log( m_myname + " createSlaveDomain: Unable to insert values in statement '" + getArg( "sql-insert-slave" ) + "' - format error", Logger::Error );
+ g_log.log( m_myname + " createSlaveDomain: Unable to insert values in statement '" + getArg( "sql-insert-slave" ) + "' - format error", Logger::Error );
return false;
}
if( len > static_cast<int>(sizeof( m_buffer )) - 1 )
{
- L.log( m_myname + " createSlaveDomain: Unable to insert values in statement '" + getArg( "sql-insert-slave" ) + "' - insufficient buffer space", Logger::Error );
+ g_log.log( m_myname + " createSlaveDomain: Unable to insert values in statement '" + getArg( "sql-insert-slave" ) + "' - insufficient buffer space", Logger::Error );
return false;
}
}
catch ( std::exception& e )
{
- L.log( m_myname + " createSlaveDomain: Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " createSlaveDomain: Caught STL exception - " + e.what(), Logger::Error );
return false;
}
{
try
{
- DLOG( L.log( m_myname + " feedRecord()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " feedRecord()", Logger::Debug ) );
if( !m_handle[WRITE] && !connectTo( m_hosts[WRITE], WRITE ) )
{
- L.log( m_myname + " feedRecord: Master server is unreachable", Logger::Error );
+ g_log.log( m_myname + " feedRecord: Master server is unreachable", Logger::Error );
return false;
}
if( len < 0 )
{
- L.log( m_myname + " feedRecord: Unable to insert values in statement '" + getArg( "sql-insert-record" ) + "' - format error", Logger::Error );
+ g_log.log( m_myname + " feedRecord: Unable to insert values in statement '" + getArg( "sql-insert-record" ) + "' - format error", Logger::Error );
return false;
}
if( len > static_cast<int>(sizeof( m_buffer )) - 1 )
{
- L.log( m_myname + " feedRecord: Unable to insert values in statement '" + getArg( "sql-insert-record" ) + "' - insufficient buffer space", Logger::Error );
+ g_log.log( m_myname + " feedRecord: Unable to insert values in statement '" + getArg( "sql-insert-record" ) + "' - insufficient buffer space", Logger::Error );
return false;
}
}
catch ( std::exception& e )
{
- L.log( m_myname + " feedRecord: Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " feedRecord: Caught STL exception - " + e.what(), Logger::Error );
return false;
}
{
try
{
- DLOG( L.log( m_myname + " startTransaction()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " startTransaction()", Logger::Debug ) );
if( !m_handle[WRITE] && !connectTo( m_hosts[WRITE], WRITE ) )
{
- L.log( m_myname + " startTransaction: Master server is unreachable", Logger::Error );
+ g_log.log( m_myname + " startTransaction: Master server is unreachable", Logger::Error );
return false;
}
if( len < 0 )
{
- L.log( m_myname + " startTransaction: Unable to convert zone id to string - format error", Logger::Error );
+ g_log.log( m_myname + " startTransaction: Unable to convert zone id to string - format error", Logger::Error );
return false;
}
if( len > static_cast<int>(sizeof( m_buffer )) - 1 )
{
- L.log( m_myname + " startTransaction: Unable to convert zone id to string - insufficient buffer space", Logger::Error );
+ g_log.log( m_myname + " startTransaction: Unable to convert zone id to string - insufficient buffer space", Logger::Error );
return false;
}
}
catch ( std::exception& e )
{
- L.log( m_myname + " startTransaction: Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " startTransaction: Caught STL exception - " + e.what(), Logger::Error );
return false;
}
{
try
{
- DLOG( L.log( m_myname + " commitTransaction()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " commitTransaction()", Logger::Debug ) );
if( !m_handle[WRITE] && !connectTo( m_hosts[WRITE], WRITE ) )
{
- L.log( m_myname + " commitTransaction: Master server is unreachable", Logger::Error );
+ g_log.log( m_myname + " commitTransaction: Master server is unreachable", Logger::Error );
return false;
}
}
catch ( std::exception& e )
{
- L.log( m_myname + " commitTransaction: Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " commitTransaction: Caught STL exception - " + e.what(), Logger::Error );
return false;
}
{
try
{
- DLOG( L.log( m_myname + " abortTransaction()", Logger::Debug ) );
+ DLOG( g_log.log( m_myname + " abortTransaction()", Logger::Debug ) );
if( !m_handle[WRITE] && !connectTo( m_hosts[WRITE], WRITE ) )
{
- L.log( m_myname + " abortTransaction: Master server is unreachable", Logger::Error );
+ g_log.log( m_myname + " abortTransaction: Master server is unreachable", Logger::Error );
return false;
}
}
catch ( std::exception& e )
{
- L.log( m_myname + " abortTransaction: Caught STL exception - " + e.what(), Logger::Error );
+ g_log.log( m_myname + " abortTransaction: Caught STL exception - " + e.what(), Logger::Error );
return false;
}