Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8145024

Require LOG_ prefix to all Unified Logging tags in the source code

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      svc
    • CPU:
      generic
    • OS:
      generic

      Description

      Currently the UL logging tags are all lower case, and could be the same string as the names of local variables. Consequently, it's difficult to grep for them in the source code. For example, to find all the classinit tags, I'd have to

      find . -name \*.cpp -print -o -name \*.hpp -print | xargs grep '[lL]og.*[^a-z]classinit[^a-z]'

      The proposal is to change the LOG_TAG_LIST macro, so that it adds a LOG_ prefix to the tags. E.g.,

      #define LOG_TAG_LIST \
        LOG_TAG(classinit) \

      -> LOG_classinit

      In the source code, we must use

       log_info(LOG_classinit)("blah")

      and we can do

      find . -name \*.cpp -print -o -name \*.hpp -print | xargs grep LOG_classinit

      But this proposal pertains only to the source code and not to the output or command-line. I.e., in the output, the "LOG_" prefix is not printed. Also, user specifies -Xlog:classinit=, not -Xlog:LOG_classinit=


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                iklam Ioi Lam
              • Votes:
                0 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: