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

[Feature] Remove System.out or System.err and use Logger for everything #2892

Open
lucianoRM opened this issue Mar 30, 2023 · 4 comments
Open

Comments

@lucianoRM
Copy link

Hello!

We are using TestNG as a framework for executing E2E tests as a service. Everything works great but I have noticed that the code has multiple places where instead of a Logger, System.out and System.err are used to print information to the screen.

For example: org.testng.internal.Version#displayBanner

It would be really cool if every console output came from a Logger like you are using in other places. This way, we can add extra information to the log line via configuration (requestId for example).
Otherwise, it's really hard for us to find important information in our logs. For example, some failure stack traces are printed this way and are imposible to find.

@krmahadevan
Copy link
Member

@lucianoRM what version are you working with? I believe TestNG 7.7.1 uses an slf4j api for its logging needs.

@lucianoRM
Copy link
Author

We are using version 7.6.1 but I can still see those System.out in the master branch

For example: https://github.com/cbeust/testng/blob/2e0c8bd9d93dc48fba799e87083cea6cb63978f4/testng-core/src/main/java/org/testng/TestNG.java#L314

@krmahadevan
Copy link
Member

@lucianoRM would you be willing to help raise a PR to fix it? We will be more than glad to help you get it merged

@lucianoRM
Copy link
Author

Yeah! I could try to. I don't know if I have the time right now though. If I find a slot, I'll send the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants