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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P3 P3
    • 9
    • None
    • hotspot
    • svc
    • generic
    • generic

      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=


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

              Created:
              Updated:
              Resolved: