< prev index next >

src/hotspot/share/logging/log.hpp

Print this page




  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  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_LOG_HPP
  25 #define SHARE_VM_LOGGING_LOG_HPP
  26 
  27 #include "logging/logLevel.hpp"
  28 #include "logging/logPrefix.hpp"
  29 #include "logging/logTagSet.hpp"
  30 #include "logging/logTag.hpp"
  31 #include "memory/allocation.hpp"
  32 #include "runtime/os.hpp"
  33 #include "utilities/debug.hpp"
  34 
  35 class LogMessageBuffer;
  36 
  37 //
  38 // Logging macros
  39 //
  40 // Usage:
  41 //   log_<level>(<comma separated log tags>)(<printf-style log arguments>);
  42 // e.g.
  43 //   log_debug(logging)("message %d", i);
  44 //
  45 // Note that these macros will not evaluate the arguments unless the logging is enabled.
  46 //
  47 #define log_error(...)   (!log_is_enabled(Error, __VA_ARGS__))   ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Error>
  48 #define log_warning(...) (!log_is_enabled(Warning, __VA_ARGS__)) ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Warning>
  49 #define log_info(...)    (!log_is_enabled(Info, __VA_ARGS__))    ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Info>
  50 #define log_debug(...)   (!log_is_enabled(Debug, __VA_ARGS__))   ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Debug>
  51 #define log_trace(...)   (!log_is_enabled(Trace, __VA_ARGS__))   ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Trace>




  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  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_LOG_HPP
  25 #define SHARE_VM_LOGGING_LOG_HPP
  26 
  27 #include "logging/logLevel.hpp"
  28 #include "logging/logPrefix.hpp"
  29 #include "logging/logTagSet.hpp"
  30 #include "logging/logTag.hpp"

  31 #include "runtime/os.hpp"
  32 #include "utilities/debug.hpp"
  33 
  34 class LogMessageBuffer;
  35 
  36 //
  37 // Logging macros
  38 //
  39 // Usage:
  40 //   log_<level>(<comma separated log tags>)(<printf-style log arguments>);
  41 // e.g.
  42 //   log_debug(logging)("message %d", i);
  43 //
  44 // Note that these macros will not evaluate the arguments unless the logging is enabled.
  45 //
  46 #define log_error(...)   (!log_is_enabled(Error, __VA_ARGS__))   ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Error>
  47 #define log_warning(...) (!log_is_enabled(Warning, __VA_ARGS__)) ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Warning>
  48 #define log_info(...)    (!log_is_enabled(Info, __VA_ARGS__))    ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Info>
  49 #define log_debug(...)   (!log_is_enabled(Debug, __VA_ARGS__))   ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Debug>
  50 #define log_trace(...)   (!log_is_enabled(Trace, __VA_ARGS__))   ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Trace>


< prev index next >