From 85b774af920a546447e5115a4a6f40d7a3305f4a Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Tue, 2 Mar 2021 03:18:51 +0000 Subject: [PATCH] 8255859: Incorrect comments in log.hpp Reviewed-by: kbarrett --- src/hotspot/share/logging/log.hpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/hotspot/share/logging/log.hpp b/src/hotspot/share/logging/log.hpp index 3d9a2682182..b0d6d83434e 100644 --- a/src/hotspot/share/logging/log.hpp +++ b/src/hotspot/share/logging/log.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -72,16 +72,16 @@ class LogMessageBuffer; // Log class for more advanced logging scenarios. // Has printf-style member functions for each log level (trace(), debug(), etc). // -// Also has outputStream compatible API for the different log-levels. -// The streams are resource allocated when requested and are accessed through -// calls to _stream() functions (trace_stream(), debug_stream(), etc). +// The (trace(), debug(), etc) functions can also be used along with the LogStream +// class to obtain an outputStream object, to be passed to various printing +// functions that accept an outputStream: // // Example usage: -// Log(logging) log; +// Log(codecache, sweep) log; // if (log.is_debug()) { -// ... // log.debug("result = %d", result).trace(" tracing info"); -// obj->print_on(log.debug_stream()); +// LogStream ls(log.debug()); +// CodeCache::print_summary(&ls, false); // } // #define Log(...) LogImpl @@ -93,13 +93,11 @@ class LogMessageBuffer; // so that redundant specification of tags or levels can be avoided. // // Example usage: -// LogTarget(Debug, gc) out; +// LogTarget(Debug, codecache, sweep) out; // if (out.is_enabled()) { -// ... -// out.print("Worker: %u", i); -// out.print(" data: %d", x); -// ... -// print_stats(out.stream()); +// out.print("result = %d", result); +// LogStream ls(out); +// CodeCache::print_summary(&ls, false); // } // #define LogTarget(level, ...) LogTargetImpl