Ignore:
Timestamp:
Jan 25, 2013, 11:34:20 PM (9 years ago)
Author:
jordan
Message:

make all the log functions/structs/enums use a single 'tr_log' namespace, such as tr_logGetQueue, tr_logAddInfo, tr_logIsLevelActive

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.c

    r13631 r13868  
    4747#include "session.h" /* tr_sessionGetPublicAddress () */
    4848#include "tr-utp.h" /* tr_utpSendTo () */
    49 #include "utils.h" /* tr_time (), tr_dbg () */
     49#include "log.h"
     50#include "utils.h" /* tr_time (), tr_logAddDebug () */
    5051
    5152#ifndef IN_MULTICAST
     
    250251        int n = 8192;
    251252        if (setsockopt (s, SOL_SOCKET, SO_RCVBUF, &n, sizeof (n)))
    252             tr_inf ("Unable to set SO_RCVBUF on socket %d: %s", s, tr_strerror (sockerrno));
     253            tr_logAddInfo ("Unable to set SO_RCVBUF on socket %d: %s", s, tr_strerror (sockerrno));
    253254    }
    254255
     
    266267    if (bind (s, (struct sockaddr *) &source_sock, sourcelen))
    267268    {
    268         tr_err (_("Couldn't set source address %s on %d: %s"),
     269        tr_logAddError (_("Couldn't set source address %s on %d: %s"),
    269270                tr_address_to_string (source_addr), s, tr_strerror (errno));
    270271        return -errno;
     
    282283        if ((tmperrno != ENETUNREACH && tmperrno != EHOSTUNREACH)
    283284                || addr->type == TR_AF_INET)
    284             tr_err (_("Couldn't connect socket %d to %s, port %d (errno %d - %s)"),
     285            tr_logAddError (_("Couldn't connect socket %d to %s, port %d (errno %d - %s)"),
    285286                    s, tr_address_to_string (addr), (int)ntohs (port), tmperrno,
    286287                    tr_strerror (tmperrno));
     
    289290    }
    290291
    291     tr_deepLog (__FILE__, __LINE__, NULL, "New OUTGOING connection %d (%s)",
    292                s, tr_peerIoAddrStr (addr, port));
     292    tr_logAddDeep (__FILE__, __LINE__, NULL, "New OUTGOING connection %d (%s)",
     293                   s, tr_peerIoAddrStr (addr, port));
    293294
    294295    return s;
     
    367368                fmt = _("Couldn't bind port %d on %s: %s (%s)");
    368369
    369             tr_err (fmt, port, tr_address_to_string (addr), tr_strerror (err), hint);
     370            tr_logAddError (fmt, port, tr_address_to_string (addr), tr_strerror (err), hint);
    370371        }
    371372        tr_netCloseSocket (fd);
     
    375376
    376377    if (!suppressMsgs)
    377         tr_dbg ("Bound socket %d to port %d on %s", fd, port, tr_address_to_string (addr));
     378        tr_logAddDebug ("Bound socket %d to port %d on %s", fd, port, tr_address_to_string (addr));
    378379
    379380    if (listen (fd, 128) == -1) {
Note: See TracChangeset for help on using the changeset viewer.