< prev index next >

src/share/vm/logging/logTag.cpp

Print this page
rev 8933 : 8046148.01


  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 #include "precompiled.hpp"
  25 #include "logging/logTag.hpp"
  26 #include "utilities/globalDefinitions.hpp"
  27 
  28 const char* LogTag::_name[] = {
  29   "", // __NO_TAG
  30 #define LOG_TAG(name) #name,
  31   LOG_TAG_LIST
  32 #undef LOG_TAG
  33 };
  34 
  35 LogTagType LogTag::from_string(const char* str) {
  36   for (uint i = 0; i < Count; i++) {
  37     if (strcasecmp(str, _name[i]) == 0) {
  38       return static_cast<LogTagType>(i);
  39     }
  40   }
  41   return __NO_TAG;
  42 }


  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 #include "precompiled.hpp"
  25 #include "logging/logTag.hpp"
  26 #include "utilities/globalDefinitions.hpp"
  27 
  28 const char* LogTag::_name[] = {
  29   "", // __NO_TAG
  30 #define LOG_TAG(name) #name,
  31   LOG_TAG_LIST
  32 #undef LOG_TAG
  33 };
  34 
  35 LogTagType LogTag::from_string(const char* str) {
  36   for (uint i = 0; i < LogTag::Count; i++) {
  37     if (strcasecmp(str, _name[i]) == 0) {
  38       return static_cast<LogTagType>(i);
  39     }
  40   }
  41   return __NO_TAG;
  42 }
< prev index next >