Changeset 2339

Show
Ignore:
Timestamp:
02/06/08 00:32:54 (11 months ago)
Author:
edmanm
Message:

r107@lysithea: edmanm | 2008-02-06 00:32:48 -0500
Rename the log namespace so we don't clash with log(double) on panther.

Location:
vidalia/trunk/src/torcontrol
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • vidalia/trunk/src/torcontrol/addressmap.cpp

    r2304 r2339  
    3939AddressMap::add(QString from, QString to, QDateTime expires) 
    4040{ 
    41   log::debug("New address mapping: %1 -> %2 (expires %3)").arg(from) 
     41  tc::debug("New address mapping: %1 -> %2 (expires %3)").arg(from) 
    4242                                                          .arg(to) 
    4343                          .arg(expires.isValid() ? expires.toString(DATE_FMT) 
  • vidalia/trunk/src/torcontrol/controlconnection.cpp

    r2304 r2339  
    6161{ 
    6262  if (isRunning()) { 
    63     log::error("Bug: Tried to call ControlConnection::connect() when the " 
     63    tc::error("Bug: Tried to call ControlConnection::connect() when the " 
    6464              "control thread is already running."); 
    6565    return; 
     
    8484{ 
    8585  _connectAttempt++; 
    86   log::debug("Connecting to Tor (Attempt %1 of %2)").arg(_connectAttempt) 
     86  tc::debug("Connecting to Tor (Attempt %1 of %2)").arg(_connectAttempt) 
    8787                                                   .arg(MAX_CONNECT_ATTEMPTS); 
    8888   
     
    131131    if (error == QAbstractSocket::ConnectionRefusedError && 
    132132        _connectAttempt < MAX_CONNECT_ATTEMPTS) { 
    133       log::debug("Control connection refused. Retrying in %1ms.") 
     133      tc::debug("Control connection refused. Retrying in %1ms.") 
    134134                                       .arg(CONNECT_RETRY_DELAY); 
    135135      _connectTimer->start(CONNECT_RETRY_DELAY); 
     
    137137      /* Exceeded maximum number of connect attempts. Give up. */ 
    138138      QString errstr = ControlSocket::toString(error); 
    139       log::error("Vidalia was unable to connect to Tor: %1").arg(errstr); 
     139      tc::error("Vidalia was unable to connect to Tor: %1").arg(errstr); 
    140140      emit connectFailed(tr("Vidalia was unable to connect to Tor. (%1)") 
    141141                                                             .arg(errstr)); 
     
    145145    /* Tor closed the connection. This is common when we send a 'shutdown' or 
    146146     * 'halt' signal to Tor and doesn't need to be logged as loudly. */ 
    147     log::warn("Tor closed the control connection."); 
     147    tc::warn("Tor closed the control connection."); 
    148148  } else { 
    149149    /* Some other error. */ 
    150150    /*XXX We may want to be emitting these so the GUI thread can learn about 
    151151     * them and display an error message. */ 
    152     log::error("Control socket error: %1").arg(ControlSocket::toString(error)); 
     152    tc::error("Control socket error: %1").arg(ControlSocket::toString(error)); 
    153153  } 
    154154} 
     
    158158ControlConnection::cancelConnect() 
    159159{ 
    160   log::warn("Control connection attempt cancelled."); 
     160  tc::warn("Control connection attempt cancelled."); 
    161161  setStatus(Disconnected); 
    162162  exit(0); 
     
    200200{ 
    201201  QMutexLocker locker(&_statusMutex); 
    202   log::debug("Control connection status changed from '%1' to '%2'") 
     202  tc::debug("Control connection status changed from '%1' to '%2'") 
    203203                                       .arg(statusString(_status)) 
    204204                                       .arg(statusString(status)); 
     
    223223    result = w->getResult(&reply, &errstr); 
    224224    if (!result) 
    225       log::error("Failed to receive control reply: %1").arg(errstr); 
     225      tc::error("Failed to receive control reply: %1").arg(errstr); 
    226226    delete w; 
    227227  } else { 
    228     log::error("Failed to send control command (%1): %2").arg(cmd.keyword()) 
     228    tc::error("Failed to send control command (%1): %2").arg(cmd.keyword()) 
    229229                                                        .arg(errstr); 
    230230    _recvMutex.unlock(); 
     
    248248  _connMutex.lock(); 
    249249  if (!_sock || _status != Connected) { 
    250     log::warn("Unable to send control command '%1' when socket status is '%2'") 
     250    tc::warn("Unable to send control command '%1' when socket status is '%2'") 
    251251                                              .arg(cmd.keyword()).arg(_status); 
    252252    _connMutex.unlock(); 
     
    286286      if (reply.getStatus() == "650") { 
    287287        /* Asynchronous event message */ 
    288         log::debug("Control Event: %1").arg(reply.toString()); 
     288        tc::debug("Control Event: %1").arg(reply.toString()); 
    289289         
    290290        if (_events) { 
     
    293293      } else { 
    294294        /* Response to a previous command */ 
    295         log::debug("Control Reply: %1").arg(reply.toString()); 
     295        tc::debug("Control Reply: %1").arg(reply.toString()); 
    296296         
    297297        _recvMutex.lock(); 
     
    303303      } 
    304304    } else { 
    305       log::error("Unable to read control reply: %1").arg(errmsg); 
     305      tc::error("Unable to read control reply: %1").arg(errmsg); 
    306306    } 
    307307  } 
     
    370370  /* Attempt to connect to Tor */ 
    371371  connect(); 
    372   log::debug("Starting control connection event loop."); 
     372  tc::debug("Starting control connection event loop."); 
    373373  exec(); 
    374   log::debug("Exited control connection event loop."); 
     374  tc::debug("Exited control connection event loop."); 
    375375 
    376376  /* Clean up the socket */ 
  • vidalia/trunk/src/torcontrol/controlsocket.cpp

    r2304 r2339  
    6565  /* Format the control command */ 
    6666  QString strCmd = cmd.toString(); 
    67   log::debug("Control Command: %1").arg(strCmd.trimmed()); 
     67  tc::debug("Control Command: %1").arg(strCmd.trimmed()); 
    6868 
    6969  /* Attempt to send the command to Tor */ 
  • vidalia/trunk/src/torcontrol/debug.h

    r2303 r2339  
    3434 
    3535 
    36 namespace log { 
     36namespace tc { 
    3737 
    3838class Message { 
  • vidalia/trunk/src/torcontrol/torprocess.cpp

    r2312 r2339  
    8888  setEnvironment(env); 
    8989 
    90   log::debug("Starting Tor using '%1 %2'").arg(app).arg(formatArguments(args)); 
     90  tc::debug("Starting Tor using '%1 %2'").arg(app).arg(formatArguments(args)); 
    9191  QProcess::start(exe, args, QIODevice::ReadOnly | QIODevice::Text); 
    9292} 
     
    102102  } 
    103103 
    104   log::debug("Stopping the Tor process."); 
     104  tc::debug("Stopping the Tor process."); 
    105105  /* Tell the process to stop */ 
    106106#if defined(Q_OS_WIN32) 
     
    113113  /* Wait for it to complete */ 
    114114  if (!waitForFinished(5000)) { 
    115     log::error("Tor failed to stop: %1").arg(errorString()); 
     115    tc::error("Tor failed to stop: %1").arg(errorString()); 
    116116    if (errmsg) { 
    117117      *errmsg =  
     
    182182{ 
    183183  if (error == QProcess::FailedToStart) { 
    184     log::error("The Tor process failed to start: %1").arg(errorString()); 
     184    tc::error("The Tor process failed to start: %1").arg(errorString()); 
    185185    /* Tor didn't start, so let everyone know why. */ 
    186186    emit startFailed(errorString()); 
    187187  } else { 
    188     log::error("Tor process error: %1").arg(errorString()); 
     188    tc::error("Tor process error: %1").arg(errorString()); 
    189189  } 
    190190}