RFR: 8229517: Support for optional asynchronous/buffered logging [v11]

Xin Liu xliu at openjdk.java.net
Fri May 7 08:13:54 UTC 2021


On Thu, 6 May 2021 14:55:35 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Xin Liu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Use LogTagSetMapping<LogTag::__NO_TAG>::tagset() instead of NULL pointer.
>
> test/hotspot/gtest/logging/test_asynclog.cpp line 44:
> 
>> 42: };
>> 43: 
>> 44: class AsyncLogTest : public LogTestFixture {
> 
> Unless you plan to add other code to this fixture I would prefer a regular RAII object like we do in hotspot, and naming it `AsyncModeMark`, and placing it at the start of each function instead. 
> 
> Reason: you can use EXPECT macros inside to test stuff and they fire as part of the test, its easier to debug, and it is common notation so hotspot devs know what this is without looking up rules about googletest fixtures.
> 
> But kudos for leaving clean state after your tests.

I tried but I found it's  difficult not to use LogTestFixture here for async logging tests.
 
The constructor and destructor of LogTestFixture help me do the chores. 
Without them, I can't use this set up function.
  `set_log_config(TestLogFileName, "logging=debug");`

-------------

PR: https://git.openjdk.java.net/jdk/pull/3135


More information about the hotspot-dev mailing list