-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revisit Dokka's logging messages and API #2944
Comments
A couple of lessons learned from Dokkatoo:
|
Update: Denis will think it through from the user's perspective (taking into consideration the CLI runner and the default Gradle/Maven levels), and also try to categorize the existing messages that Dokka emits. Once that's done and we understand what we want to achieve in the end, it can be implemented in code, with API changes if necessary. |
Update: Denis went through all of the existing messages and tried to group them together to see the trends. Based on it, we've worked out some guidelines for each logging level about how they should be used by developers and how they should be mapped/displayed by the runners. We will next try to change the logging levels of the current messages to adhere to the agreed upon guidelines, which will also help validate them. Increasing the logging coverage seems to be out of scope of this issue, and should be done separately. |
Plans:
|
Co-authored-by: Denis Ambatenne <[email protected]> Co-authored-by: IgnatBeresnev <[email protected]>
Co-authored-by: Denis Ambatenne <[email protected]> Co-authored-by: IgnatBeresnev <[email protected]>
@d-ambatenne there was a PR for that issue. |
There's a number of complaints related to Dokka's logging messages:
The majority of the reports can be summed up as "Dokka logs too many irrelevant messages".
At first, the problem might come off as being runner-specific. For instance, one might think the Gradle runner's mapping of logging levels is incorrect. So the obvious solution is to just re-route it like in #2915.
However, the problem itself is deeper than that.
Meeting user expectations
It'd be ideal to start with understanding what Dokka should log by default under default runner configurations (like running the Gradle tasks with no additional flags).
The decision might be runner-dependant. For example, Dokka might log nothing when run with the Gradle runner as Gradle itself reports task progress, so the users will be able to see that Dokka is working. However, it's not acceptable for the CLI runner - it reports nothing by itself, so if it completes silently the users might think it didn't work. For this reason, maybe Dokka's
PROGRESS
level should be used exclusively for the CLI runner, or a separate level / mechanism needs to be introduced for that.The goal here is so that the general and broad user expectations are met when Dokka is run with different runners.
DokkaLogger API
DokkaLogger is considered to be an abstraction for logging.
At the moment, it's not very clear how to use this API. The following questions should be addressed:
info
and which underprogress
? What is the default logging level that the users will see messages of? Some guidance needs to be added so that developers/contributors/plugin authors know when to use each level.PROGRESS
more important thanINFO
? At the moment, the order of functions inDokkaLogger
leads to to believe thatPROGRES > INFO
. However, if you look atLoggingLevel#index
, you'll see thatPROGRESS < INFO
. MaybePROGRESS
needs to stand on its own and not be compared to other levels at all.Logging level mapping
Once the API questions have been addressed, the mapping of Dokka's logging levels should be revisited. The implementations of
DokkaLogger
should be consistent for our runners.lifecycle
, which now corresponds to Dokka'sPROGRESS
. However, if Dokka'sPROGRESS < INFO
, this mapping is incorrect, and it needs to be adjusted.PROGRESS
orLIFECYCLE
. However, it does have thetrace
leve, which other runners don't. At the moment, Dokka'sPROGRESS
andINFO
both get mapped to Maven'sINFO
, which might be incorrect.Existing logging messages
Dokka emites many redundant messages already. For example, it logs the execution time of its steps under
INFO
.Chances are, after the API refactoring outlined above, it might emit even more redundant messages than before, so the existing messages need to be revisited: they can be removed/re-written or their logging level can be changed.
Note: there's a configuration property
DokkaConfiguration#failOnWarning
- the behaviour should be preserved, so pay attention to messages with theWARN
level.The text was updated successfully, but these errors were encountered: