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/upnp.c

    r13631 r13868  
    2727
    2828#include "transmission.h"
     29#include "log.h"
    2930#include "port-forwarding.h"
    3031#include "session.h"
     
    102103
    103104    if (ret != UPNPCOMMAND_SUCCESS)
    104         tr_ndbg (getKey (), "upnpDiscover failed (errno %d - %s)", err, tr_strerror (err));
     105        tr_logAddNamedDbg (getKey (), "upnpDiscover failed (errno %d - %s)", err, tr_strerror (err));
    105106
    106107    return ret;
     
    150151
    151152    if (err)
    152         tr_ndbg (getKey (), "%s Port forwarding failed with error %d (errno %d - %s)", proto, err, errno, tr_strerror (errno));
     153        tr_logAddNamedDbg (getKey (), "%s Port forwarding failed with error %d (errno %d - %s)", proto, err, errno, tr_strerror (errno));
    153154
    154155    errno = old_errno;
     
    198199                             handle->lanaddr, sizeof (handle->lanaddr)) == UPNP_IGD_VALID_CONNECTED)
    199200        {
    200             tr_ninf (getKey (), _(
     201            tr_logAddNamedInfo (getKey (), _(
    201202                         "Found Internet Gateway Device \"%s\""),
    202203                     handle->urls.controlURL);
    203             tr_ninf (getKey (), _(
     204            tr_logAddNamedInfo (getKey (), _(
    204205                         "Local Address is \"%s\""), handle->lanaddr);
    205206            handle->state = TR_UPNP_IDLE;
     
    209210        {
    210211            handle->state = TR_UPNP_ERR;
    211             tr_ndbg (
     212            tr_logAddNamedDbg (
    212213                 getKey (), "UPNP_GetValidIGD failed (errno %d - %s)",
    213214                errno,
    214215                tr_strerror (errno));
    215             tr_ndbg (
     216            tr_logAddNamedDbg (
    216217                getKey (),
    217218                "If your router supports UPnP, please make sure UPnP is enabled!");
     
    231232          (tr_upnpGetSpecificPortMappingEntry (handle, "UDP") != UPNPCOMMAND_SUCCESS))
    232233        {
    233             tr_ninf (getKey (), _("Port %d isn't forwarded"), handle->port);
     234            tr_logAddNamedInfo (getKey (), _("Port %d isn't forwarded"), handle->port);
    234235            handle->isMapped = false;
    235236        }
     
    241242        tr_upnpDeletePortMapping (handle, "UDP", handle->port);
    242243
    243         tr_ninf (getKey (),
     244        tr_logAddNamedInfo (getKey (),
    244245                 _("Stopping port forwarding through \"%s\", service \"%s\""),
    245246                 handle->urls.controlURL, handle->data.first.servicetype);
     
    274275            handle->isMapped = !err_tcp | !err_udp;
    275276        }
    276         tr_ninf (getKey (),
     277        tr_logAddNamedInfo (getKey (),
    277278                 _("Port forwarding through \"%s\", service \"%s\". (local address: %s:%d)"),
    278279                 handle->urls.controlURL, handle->data.first.servicetype,
     
    280281        if (handle->isMapped)
    281282        {
    282             tr_ninf (getKey (), "%s", _("Port forwarding successful!"));
     283            tr_logAddNamedInfo (getKey (), "%s", _("Port forwarding successful!"));
    283284            handle->port = port;
    284285            handle->state = TR_UPNP_IDLE;
     
    286287        else
    287288        {
    288             tr_ndbg (getKey (), "If your router supports UPnP, please make sure UPnP is enabled!");
     289            tr_logAddNamedDbg (getKey (), "If your router supports UPnP, please make sure UPnP is enabled!");
    289290            handle->port = -1;
    290291            handle->state = TR_UPNP_ERR;
Note: See TracChangeset for help on using the changeset viewer.