view hotspot/src/share/vm/logging/logLevel.hpp @ 34252:59d76c40998a

8143229: Replace the develop level with develop macros in Unified Logging Reviewed-by: brutisso, coleenp, dholmes, rprotacio
author mlarsson
date Fri, 20 Nov 2015 12:42:21 +0100
parents 96e348cb0442
children 4d876653d940
line wrap: on
line source
/*
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 *
 */
#ifndef SHARE_VM_LOGGING_LOGLEVEL_HPP
#define SHARE_VM_LOGGING_LOGLEVEL_HPP

#include "memory/allocation.hpp"
#include "utilities/macros.hpp"

// The list of log levels:
//
//  trace   - Finest level of logging. Use for extensive/noisy
//            logging that can give slow-down when enabled.
//
//  debug   - A finer level of logging. Use for semi-noisy
//            logging that is does not fit the info level.
//
//  info    - General level of logging. Use for significant
//            events and/or informative summaries.
//
//  warning - Important messages that are not strictly errors.
//
//  error   - Critical messages caused by errors.
//
#define LOG_LEVEL_LIST \
  LOG_LEVEL(Trace, trace) \
  LOG_LEVEL(Debug, debug) \
  LOG_LEVEL(Info, info) \
  LOG_LEVEL(Warning, warning) \
  LOG_LEVEL(Error, error)

class LogLevel : public AllStatic {
 public:
  enum type {
    Off,
#define LOG_LEVEL(name, printname) name,
    LOG_LEVEL_LIST
#undef LOG_LEVEL
    Count,
    Invalid,
    First = Off + 1,
    Last = Error,
    Default = Warning,
    Unspecified = Info
  };

  static const char *name(LogLevel::type level) {
    return _name[level];
  }

  static LogLevel::type from_string(const char* str);

 private:
  static const char* _name[];
};

typedef LogLevel::type LogLevelType;

#endif // SHARE_VM_LOGGING_LOGLEVEL_HPP