Changeset 5e507c0


Ignore:
Timestamp:
Aug 28, 2011 5:26:34 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
e768b35
Parents:
948de54
Message:

log tweaks

Location:
router/java/src/net/i2p/router
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/OutNetMessage.java

    r948de54 r5e507c0  
    144144    public RouterInfo getTarget() { return _target; }
    145145    public void setTarget(RouterInfo target) { _target = target; }
     146
    146147    /**
    147148     * Specifies the message to be sent
     
    149150     */
    150151    public I2NPMessage getMessage() { return _message; }
     152
    151153    public void setMessage(I2NPMessage msg) {
    152154        _message = msg;
    153155        if (msg != null) {
    154             _messageType = msg.getClass().getName();
     156            _messageType = msg.getClass().getSimpleName();
    155157            _messageTypeId = msg.getType();
    156158            _messageId = msg.getUniqueId();
     
    159161    }
    160162   
     163    /**
     164     *  @return the simple class name
     165     */
    161166    public String getMessageType() { return _messageType; }
     167
    162168    public int getMessageTypeId() { return _messageTypeId; }
    163169    public long getMessageId() { return _messageId; }
     
    274280     */
    275281    public void discardData() {
    276         long timeToDiscard = _context.clock().now() - _created;
    277282        if ( (_message != null) && (_messageSize <= 0) )
    278283            _messageSize = _message.getMessageSize();
    279         if (_log.shouldLog(Log.DEBUG))
     284        if (_log.shouldLog(Log.DEBUG)) {
     285            long timeToDiscard = _context.clock().now() - _created;
    280286            _log.debug("Discard " + _messageSize + "byte " + _messageType + " message after "
    281287                       + timeToDiscard);
     288        }
    282289        _message = null;
    283290        //_context.statManager().addRateData("outNetMessage.timeToDiscard", timeToDiscard, timeToDiscard);
     
    313320        } else {
    314321            buf.append("a ").append(_messageSize).append(" byte ");
    315             buf.append(_message.getClass().getName());
     322            buf.append(_messageType);
    316323        }
    317324        buf.append(" expiring on ").append(new Date(_expiration));
  • router/java/src/net/i2p/router/transport/TransportImpl.java

    r948de54 r5e507c0  
    205205        if (msToSend > 1000) {
    206206            if (_log.shouldLog(Log.WARN))
    207                 _log.warn("afterSend slow: [success=" + sendSuccessful + "] " + msg.getMessageSize() + "byte "
     207                _log.warn("afterSend slow: [success=" + sendSuccessful + "] " + msg.getMessageSize() + " byte "
    208208                          + msg.getMessageType() + " " + msg.getMessageId() + " to "
    209209                          + msg.getTarget().getIdentity().calculateHash().toBase64().substring(0,6) + " took " + msToSend
     
    219219                level = Log.INFO;
    220220            if (_log.shouldLog(level))
    221                 _log.log(level, "afterSend slow (" + lifetime + "/" + msToSend + "/" + msg.getTransmissionTime() + "): [success=" + sendSuccessful + "]" + msg.getMessageSize() + "byte "
     221                _log.log(level, "afterSend slow (" + lifetime + "/" + msToSend + "/" + msg.getTransmissionTime() + "): [success=" + sendSuccessful + "] " + msg.getMessageSize() + " byte "
    222222                          + msg.getMessageType() + " " + msg.getMessageId() + " from " + _context.routerHash().toBase64().substring(0,6)
    223223                          + " to " + msg.getTarget().getIdentity().calculateHash().toBase64().substring(0,6) + ": " + msg.toString());
    224224        } else {
    225225            if (_log.shouldLog(Log.INFO))
    226                 _log.info("afterSend: [success=" + sendSuccessful + "]" + msg.getMessageSize() + "byte "
     226                _log.info("afterSend: [success=" + sendSuccessful + "] " + msg.getMessageSize() + " byte "
    227227                          + msg.getMessageType() + " " + msg.getMessageId() + " from " + _context.routerHash().toBase64().substring(0,6)
    228228                          + " to " + msg.getTarget().getIdentity().calculateHash().toBase64().substring(0,6) + "\n" + msg.toString());
Note: See TracChangeset for help on using the changeset viewer.