Improve logging documentation to advice performance consideration

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: core-libs
    • None

      Improve logging documentation w.r.t. the performance advices from Laurent Bourges:

      Bad practices:
      - string concat:
          log.fine("message" + value); // means StringBuilder(message).append(String.valueOf(value)).toString(): 2 objects created and value.toString() called
      - varags:
          log.fine("message {0}", this); // create an Object[]

      Best practices:
      if (log.isLoggable(PlatformLogger.FINE) {
          log.fine("message" + value);
      }

      if (log.isLoggable(PlatformLogger.FINE) {
          log.fine("message {0}", this);
      }

            Assignee:
            Unassigned
            Reporter:
            Mandy Chung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: