Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-2130

Log: cache result of log.isTraceEnabled()

    Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.0
    • Labels:

      Description

      e.g.

      boolean trace=log.isTraceEnabled();
      loop {
         if(trace) ...
      }
      

      Unfortunately, isTraceEnabled() is not free in most scenarios, so the cost of invoking this method should be amortized over multiple calls.

      I don't want to cache this at a global level, or else we wouldn't be able to change the log level at runtime...

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                belaban Bela Ban
                Reporter:
                belaban Bela Ban
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: