src/share/vm/logging/logTag.hpp

Print this page
rev 9245 : [mq]: class_loading_log


  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 #ifndef SHARE_VM_LOGGING_LOGTAG_HPP
  25 #define SHARE_VM_LOGGING_LOGTAG_HPP
  26 
  27 #include "memory/allocation.hpp"
  28 #include "utilities/globalDefinitions.hpp"
  29 
  30 // List of available logging tags. New tags should be added here.
  31 // (The tags 'all', 'disable' and 'help' are special tags that can
  32 // not be used in log calls, and should not be listed below.)
  33 #define LOG_TAG_LIST \


  34   LOG_TAG(defaultmethods) \
  35   LOG_TAG(logging)
  36 
  37 #define PREFIX_LOG_TAG(T) (LogTag::T)
  38 
  39 // Expand a set of log tags to their prefixed names.
  40 // For error detection purposes, the macro passes one more tag than what is supported.
  41 // If too many tags are given, a static assert in the log class will fail.
  42 #define LOG_TAGS_EXPANDED(T0, T1, T2, T3, T4, T5, ...)  PREFIX_LOG_TAG(T0), PREFIX_LOG_TAG(T1), PREFIX_LOG_TAG(T2), \
  43                                                         PREFIX_LOG_TAG(T3), PREFIX_LOG_TAG(T4), PREFIX_LOG_TAG(T5)
  44 // The EXPAND_VARARGS macro is required for MSVC, or it will resolve the LOG_TAGS_EXPANDED macro incorrectly.
  45 #define EXPAND_VARARGS(x) x
  46 #define LOG_TAGS(...) EXPAND_VARARGS(LOG_TAGS_EXPANDED(__VA_ARGS__, __NO_TAG, __NO_TAG, __NO_TAG, __NO_TAG, __NO_TAG, __NO_TAG))
  47 
  48 // Log tags are used to classify log messages.
  49 // Each log message can be assigned between 1 to LogTag::MaxTags number of tags.
  50 // Specifying multiple tags for a log message means that only outputs configured
  51 // for those exact tags, or a subset of the tags with a wildcard, will see the logging.
  52 // Multiple tags should be comma separated, e.g. log_error(tag1, tag2)("msg").
  53 class LogTag : public AllStatic {




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 #ifndef SHARE_VM_LOGGING_LOGTAG_HPP
  25 #define SHARE_VM_LOGGING_LOGTAG_HPP
  26 
  27 #include "memory/allocation.hpp"
  28 #include "utilities/globalDefinitions.hpp"
  29 
  30 // List of available logging tags. New tags should be added here.
  31 // (The tags 'all', 'disable' and 'help' are special tags that can
  32 // not be used in log calls, and should not be listed below.)
  33 #define LOG_TAG_LIST \
  34   LOG_TAG(classload) \
  35   LOG_TAG(classloaderdata) \
  36   LOG_TAG(defaultmethods) \
  37   LOG_TAG(logging)
  38 
  39 #define PREFIX_LOG_TAG(T) (LogTag::T)
  40 
  41 // Expand a set of log tags to their prefixed names.
  42 // For error detection purposes, the macro passes one more tag than what is supported.
  43 // If too many tags are given, a static assert in the log class will fail.
  44 #define LOG_TAGS_EXPANDED(T0, T1, T2, T3, T4, T5, ...)  PREFIX_LOG_TAG(T0), PREFIX_LOG_TAG(T1), PREFIX_LOG_TAG(T2), \
  45                                                         PREFIX_LOG_TAG(T3), PREFIX_LOG_TAG(T4), PREFIX_LOG_TAG(T5)
  46 // The EXPAND_VARARGS macro is required for MSVC, or it will resolve the LOG_TAGS_EXPANDED macro incorrectly.
  47 #define EXPAND_VARARGS(x) x
  48 #define LOG_TAGS(...) EXPAND_VARARGS(LOG_TAGS_EXPANDED(__VA_ARGS__, __NO_TAG, __NO_TAG, __NO_TAG, __NO_TAG, __NO_TAG, __NO_TAG))
  49 
  50 // Log tags are used to classify log messages.
  51 // Each log message can be assigned between 1 to LogTag::MaxTags number of tags.
  52 // Specifying multiple tags for a log message means that only outputs configured
  53 // for those exact tags, or a subset of the tags with a wildcard, will see the logging.
  54 // Multiple tags should be comma separated, e.g. log_error(tag1, tag2)("msg").
  55 class LogTag : public AllStatic {