Changeset 37819286


Ignore:
Timestamp:
Sep 10, 2012 5:22:51 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
835ed6d
Parents:
2f98d05
Message:

logging cleanups

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • apps/streaming/java/src/net/i2p/client/streaming/MessageOutputStream.java

    r2f98d05 r37819286  
    390390        // false -> wait for completion, not just accept.
    391391        flush(false);
    392         _log.debug("Output stream closed after writing " + _written);
     392        if (_log.shouldLog(Log.DEBUG))
     393            _log.debug("Output stream closed after writing " + _written);
    393394        ByteArray ba = null;
    394395        synchronized (_dataLock) {
  • core/java/src/net/i2p/util/SimpleScheduler.java

    r2f98d05 r37819286  
    175175            if (time > 1000 && _log.shouldLog(Log.WARN))
    176176                _log.warn(_name + " wtf, event execution took " + time + ": " + _timedEvent);
    177             long completed = _executor.getCompletedTaskCount();
    178             if (_log.shouldLog(Log.INFO) && completed % 250  == 0)
    179                 _log.info(debug());
     177            if (_log.shouldLog(Log.INFO)) {
     178                 // this call is slow - iterates through a HashMap -
     179                 // would be better to have a local AtomicLong if we care
     180                 long completed = _executor.getCompletedTaskCount();
     181                 if (completed % 250 == 0)
     182                     _log.info(debug());
     183            }
    180184        }
    181185    }
  • core/java/src/net/i2p/util/SimpleTimer2.java

    r2f98d05 r37819286  
    369369            if (time > 500 && _log.shouldLog(Log.WARN))
    370370                _log.warn(_pool + " wtf, event execution took " + time + ": " + this);
    371             long completed = _pool.getCompletedTaskCount();
    372             if (_log.shouldLog(Log.INFO) && completed % 250  == 0)
    373                 _log.info(_pool.debug());
     371            if (_log.shouldLog(Log.INFO)) {
     372                 // this call is slow - iterates through a HashMap -
     373                 // would be better to have a local AtomicLong if we care
     374                 long completed = _pool.getCompletedTaskCount();
     375                 if (completed % 250 == 0)
     376                     _log.info(_pool.debug());
     377            }
    374378        }
    375379
     
    388392    }
    389393
     394    /** warning - slow */
    390395    private long getCompletedTaskCount() {
    391396        return _executor.getCompletedTaskCount();
  • router/java/src/net/i2p/router/networkdb/kademlia/PersistentDataStore.java

    r2f98d05 r37819286  
    450450                            getContext().profileManager().heardAbout(ri.getIdentity().getHash(), ri.getPublished());
    451451                        } catch (IllegalArgumentException iae) {
    452                             _log.info("Refused locally loaded routerInfo - deleting", iae);
     452                            if (_log.shouldLog(Log.INFO))
     453                                _log.info("Refused locally loaded routerInfo - deleting", iae);
    453454                            corrupt = true;
    454455                        }
     
    525526        if (f.exists()) {
    526527            boolean removed = f.delete();
    527             if (!removed)
    528                 _log.warn("Unable to remove router info at " + f.getAbsolutePath());
    529             else
     528            if (!removed) {
     529                if (_log.shouldLog(Log.WARN))
     530                    _log.warn("Unable to remove router info at " + f.getAbsolutePath());
     531            } else if (_log.shouldLog(Log.INFO)) {
    530532                _log.info("Removed router info at " + f.getAbsolutePath());
     533            }
    531534            return;
    532535        }
Note: See TracChangeset for help on using the changeset viewer.