Skip to content
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

enhance logging concept #404

Open
hohwille opened this issue Jun 20, 2024 · 0 comments · May be fixed by #1017
Open

enhance logging concept #404

hohwille opened this issue Jun 20, 2024 · 0 comments · May be fixed by #1017
Assignees
Labels
enhancement New feature or request logging

Comments

@hohwille
Copy link
Member

hohwille commented Jun 20, 2024

In IDEasy we have created our own logger below IdeContext.
This has some special feature and somehow makes sense since what we want for the regular end-user is something different than what a regular logger provides...

However, from a design PoV (and during JUnits) regular logging via SLF4J has several advantages:

  • logger can be defined as static final constant simplifying dependencies (no IdeContext must be passed to constructor of every class that wants to log something)
  • during the tests we can see which class was triggering the logging

On the other hand we have some edge-cases that cannot be easily addressed by SLF4J:

  • custom log-levels like step or interaction
  • advanced test-support where we can assert that specific lines or fragments have been logged

The idea of this story is to analyze and after agreement also implement some improvement to our logging.
Currently I am thinking about a hybrid approach:

  • What if any class in IDEasy could also log with SLF4J - During JUnits we would then use logback see the regular log output including the Class containing the log statement.
  • By implementing our own SLF4J Bridge Implementation, we could make SLF4J log to our custom logger in regular IDEasy CLI usage.
  • We could investigate if SLF4J API & core would work in GraalVM (what should already be sure) and still not increase our footprint (native-image size, performance, memory consumption, etc. - what is also 99% likely). If results are fine, we could decide for this apprach and include SLF4J into IDEasy.
  • We could even evaluate if SLF4J API can somehow support custom log-levels (e.g. via Markers). Otherwise I would suggest an hybrid approach where the current ldeContext logger remains as is and we add a SLF4J Bridge that delegates to it (in the worst case we would again need to go back to a static instance variable holding the latest IdeContext instance like we had before).

Wouldn't that be a great improvement?

@hohwille hohwille added the enhancement New feature or request label Jun 20, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Jun 20, 2024
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Sep 9, 2024
@KianRolf KianRolf self-assigned this Oct 30, 2024
@KianRolf KianRolf assigned jan-vcapgemini and unassigned KianRolf Nov 29, 2024
jan-vcapgemini added a commit to KianRolf/IDEasy that referenced this issue Jan 22, 2025
renamed TestLogger to IdeLoggerAdapter
added missing param to javadoc
renamed TestProvider to TestProviderImpl
renamed TestLoggerFactory to TestLoggerFactoryImpl
jan-vcapgemini added a commit to KianRolf/IDEasy that referenced this issue Jan 27, 2025
added first implementations for IdeLoggerAdapter methods
replaced IdeSubLoggerSlf4j with IdeSubLoggerOut
jan-vcapgemini added a commit to KianRolf/IDEasy that referenced this issue Jan 27, 2025
added null checks to IdeLoggerAdapter debug methods
jan-vcapgemini added a commit to KianRolf/IDEasy that referenced this issue Jan 28, 2025
added rest of null checks
jan-vcapgemini added a commit to KianRolf/IDEasy that referenced this issue Jan 28, 2025
fixed compose array out of bounds exception
jan-vcapgemini added a commit to KianRolf/IDEasy that referenced this issue Feb 4, 2025
updated WireMock dependency from 2.35.2 to 3.11.0
added jackson-core dependency to ide-cli
added url namespace to tools
added LogbackServiceProvider to service
@jan-vcapgemini jan-vcapgemini linked a pull request Feb 4, 2025 that will close this issue
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Feb 5, 2025
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Feb 5, 2025
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Feb 5, 2025
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Feb 5, 2025
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Feb 5, 2025
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request logging
Projects
Status: 🏗 In progress
Development

Successfully merging a pull request may close this issue.

3 participants