annotate src/share/vm/logging/logDecorations.hpp @ 9046:f99ad7bb5df5

8046148: JEP 158: Unified JVM Logging Reviewed-by: coleenp, sla
author mlarsson
date Thu, 24 Sep 2015 12:36:04 +0200
parents
children b0cdcfe42ebf
rev   line source
mlarsson@9046 1 /*
mlarsson@9046 2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
mlarsson@9046 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
mlarsson@9046 4 *
mlarsson@9046 5 * This code is free software; you can redistribute it and/or modify it
mlarsson@9046 6 * under the terms of the GNU General Public License version 2 only, as
mlarsson@9046 7 * published by the Free Software Foundation.
mlarsson@9046 8 *
mlarsson@9046 9 * This code is distributed in the hope that it will be useful, but WITHOUT
mlarsson@9046 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mlarsson@9046 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mlarsson@9046 12 * version 2 for more details (a copy is included in the LICENSE file that
mlarsson@9046 13 * accompanied this code).
mlarsson@9046 14 *
mlarsson@9046 15 * You should have received a copy of the GNU General Public License version
mlarsson@9046 16 * 2 along with this work; if not, write to the Free Software Foundation,
mlarsson@9046 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
mlarsson@9046 18 *
mlarsson@9046 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
mlarsson@9046 20 * or visit www.oracle.com if you need additional information or have any
mlarsson@9046 21 * questions.
mlarsson@9046 22 *
mlarsson@9046 23 */
mlarsson@9046 24 #ifndef SHARE_VM_LOGGING_LOGDECORATIONS_HPP
mlarsson@9046 25 #define SHARE_VM_LOGGING_LOGDECORATIONS_HPP
mlarsson@9046 26
mlarsson@9046 27 #include "logging/logDecorators.hpp"
mlarsson@9046 28 #include "logging/logTagSet.hpp"
mlarsson@9046 29 #include "memory/allocation.hpp"
mlarsson@9046 30
mlarsson@9046 31 // Temporary object containing the necessary data for a log call's decorations (timestamps, etc).
mlarsson@9046 32 class LogDecorations VALUE_OBJ_CLASS_SPEC {
mlarsson@9046 33 public:
mlarsson@9046 34 static const int DecorationsBufferSize = 256;
mlarsson@9046 35 private:
mlarsson@9046 36 char _decorations_buffer[DecorationsBufferSize];
mlarsson@9046 37 char* _decoration_offset[LogDecorators::Count];
mlarsson@9046 38 LogLevelType _level;
mlarsson@9046 39 LogTagSet _tagset;
mlarsson@9046 40 jlong _millis;
mlarsson@9046 41 static jlong _vm_start_time_millis;
mlarsson@9046 42
mlarsson@9046 43 jlong java_millis();
mlarsson@9046 44 void create_decorations(const LogDecorators& decorators);
mlarsson@9046 45
mlarsson@9046 46 #define DECORATOR(name, abbr) char* create_##name##_decoration(char* pos);
mlarsson@9046 47 DECORATOR_LIST
mlarsson@9046 48 #undef DECORATOR
mlarsson@9046 49
mlarsson@9046 50 public:
mlarsson@9046 51 LogDecorations(LogLevelType level, const LogTagSet& tagset, const LogDecorators& decorators);
mlarsson@9046 52
mlarsson@9046 53 const char* decoration(LogDecorators::Decorator decorator) const {
mlarsson@9046 54 return _decoration_offset[decorator];
mlarsson@9046 55 }
mlarsson@9046 56
mlarsson@9046 57 static void set_vm_start_time_millis(jlong start_time) {
mlarsson@9046 58 _vm_start_time_millis = start_time;
mlarsson@9046 59 }
mlarsson@9046 60 };
mlarsson@9046 61
mlarsson@9046 62 #endif // SHARE_VM_LOGGING_LOGDECORATIONS_HPP