src/hotspot/share/logging/logTagLevelExpression.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File webrev Sdiff src/hotspot/share/logging

src/hotspot/share/logging/logTagLevelExpression.hpp

Print this page




  23  */
  24 #ifndef SHARE_VM_LOGGING_LOGTAGLEVELEXPRESSION_HPP
  25 #define SHARE_VM_LOGGING_LOGTAGLEVELEXPRESSION_HPP
  26 
  27 #include "logging/logConfiguration.hpp"
  28 #include "logging/logLevel.hpp"
  29 #include "logging/logTag.hpp"
  30 #include "memory/allocation.hpp"
  31 #include "utilities/debug.hpp"
  32 #include "utilities/globalDefinitions.hpp"
  33 
  34 class LogTagSet;
  35 
  36 // Class used to temporary encode a 'what'-expression during log configuration.
  37 // Consists of a combination of tags and levels, e.g. "tag1+tag2=level1,tag3*=level2".
  38 class LogTagLevelExpression : public StackObj {
  39  public:
  40   static const size_t MaxCombinations = 256;
  41 
  42  private:
  43   friend void LogConfiguration::configure_stdout(LogLevelType, bool, ...);
  44 
  45   static const char* DefaultExpressionString;
  46 
  47   size_t        _ntags, _ncombinations;
  48   LogTagType    _tags[MaxCombinations][LogTag::MaxTags];
  49   LogLevelType  _level[MaxCombinations];
  50   bool          _allow_other_tags[MaxCombinations];
  51 
  52   void new_combination() {
  53     // Make sure either all tags are set or the last tag is __NO_TAG
  54     if (_ntags < LogTag::MaxTags) {
  55       _tags[_ncombinations][_ntags] = LogTag::__NO_TAG;
  56     }
  57 
  58     _ncombinations++;
  59     _ntags = 0;
  60   }
  61 
  62   bool add_tag(LogTagType tag) {
  63     assert(_ntags < LogTag::MaxTags, "Can't have more tags than MaxTags!");




  23  */
  24 #ifndef SHARE_VM_LOGGING_LOGTAGLEVELEXPRESSION_HPP
  25 #define SHARE_VM_LOGGING_LOGTAGLEVELEXPRESSION_HPP
  26 
  27 #include "logging/logConfiguration.hpp"
  28 #include "logging/logLevel.hpp"
  29 #include "logging/logTag.hpp"
  30 #include "memory/allocation.hpp"
  31 #include "utilities/debug.hpp"
  32 #include "utilities/globalDefinitions.hpp"
  33 
  34 class LogTagSet;
  35 
  36 // Class used to temporary encode a 'what'-expression during log configuration.
  37 // Consists of a combination of tags and levels, e.g. "tag1+tag2=level1,tag3*=level2".
  38 class LogTagLevelExpression : public StackObj {
  39  public:
  40   static const size_t MaxCombinations = 256;
  41 
  42  private:
  43   friend void LogConfiguration::configure_stdout(LogLevelType, int, ...);
  44 
  45   static const char* DefaultExpressionString;
  46 
  47   size_t        _ntags, _ncombinations;
  48   LogTagType    _tags[MaxCombinations][LogTag::MaxTags];
  49   LogLevelType  _level[MaxCombinations];
  50   bool          _allow_other_tags[MaxCombinations];
  51 
  52   void new_combination() {
  53     // Make sure either all tags are set or the last tag is __NO_TAG
  54     if (_ntags < LogTag::MaxTags) {
  55       _tags[_ncombinations][_ntags] = LogTag::__NO_TAG;
  56     }
  57 
  58     _ncombinations++;
  59     _ntags = 0;
  60   }
  61 
  62   bool add_tag(LogTagType tag) {
  63     assert(_ntags < LogTag::MaxTags, "Can't have more tags than MaxTags!");


src/hotspot/share/logging/logTagLevelExpression.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File