RFR: 8286117: Remove unnecessary indirection and unused code in UL [v2]

David Holmes dholmes at openjdk.java.net
Tue May 10 02:36:43 UTC 2022


On Mon, 9 May 2022 17:32:48 GMT, Johan Sjölén <duke at openjdk.java.net> wrote:

>> That seems a bit odd to me. Why can't we use the actual thing we will log to? The description of LogMessage is that it is a multi-part log entry that is accumulated until we flush it by writing to the actual log device.
>
> This is the dependency-structure of UL before this PR (this PR moves the arrows into `LogImpl` directly into `LogTagSet`). `LogTagSet` knows what it logs to, because it has access to the `LogOutputList`, nothing else has such info (which is why every arrow goes into LogTagSet). This is why `LogMessage` doesn't know what it will flush to, `LogTagSet` redirects to the correct outputs.
> 
> ![loggers](https://user-images.githubusercontent.com/103041674/167464762-80c6cd61-797a-4bd8-b7f3-609a8d95a0e7.png)
> 
> Circles = external API, rectangle = internal to UL.

Thanks for that picture! I think my main problem is that `LogTagSet` is actually a much more fundamental abstraction than I was thinking it was from the name. It really embodies a complete entity of logging that I can't readily describe without using words (target, configuration) already used for something else in UL. In that sense `LogImpl` actually did add a level of abstraction that made things a little clearer (and I think `LogImpl` is perhaps what they chose to describe that because they couldn't just use `Log`).
Okay things are a bit clearer now. Thanks.

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

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


More information about the hotspot-runtime-dev mailing list