Provide logger instead of sys outs.
Hi, During client code generation getting below sysouts. It would be great if you provide logger instead of sysouts.
Sysout: reading from.... writing file
I believe we've done that already. Are you using the latest master?
@wing328 Just checked master. Writing file sysout removed but reading from sys out still present at line no 77 for Swagger20Parser.java https://github.com/swagger-api/swagger-parser/blob/master/modules/swagger-parser/src/main/java/io/swagger/parser/Swagger20Parser.java
May I know if you've cycle to submit a PR for that?
@wing328 ... If I will get time on coming weekend Will let you know..
@sbelan do you need help submitting the PR?
@wing328 ...hey sorry for the delay..was busy with other issues. Will surely do on coming weekend and let you know if any help requires.
@wing328 ... I am doing this first time... I followed below steps.
- Forked master
- Changed java unit
Right now I want to test it before submit the PR. Please let me know, Is there any guideline for testing? Also share me link for PR submit process.
@wing328 ... I did testing using > mvn test. During testing I found one more issue as below, because of this debug statements are not coming:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
To fix this, I have added
slf4j-simple jar.
http://www.slf4j.org/manual.html After that I am able to see my logs. Please find attached files for test report. After_Fix_Test_Report.txt BeforeFix_Test_Report.txt IssueFix_Test_Report_DebugEnabled.txt
@wing328 ... one more observation from my side when digging out code. As we are using slf4j facade then we don't need to check System.getProperty("debugParser") for each info statements, instead of this we can use formatting param method > {} provided by sl4fJ. Below is the example:
logger.debug("Value {} was inserted between {} and {}.", newVal, below, above);
http://www.slf4j.org/faq.html#logging_performance
RE: 1. Forked master
Are you referring to the master of Swagger Parser (https://github.com/swagger-api/swagger-parser)?
RE: http://www.slf4j.org/faq.html#logging_performance
The URL is broken.
@wing328 ...
- Yes I am referring the master of swagger parser
- I am able to access above URL. Other way you can tray like goto http://www.slf4j.org/ then ---> documentation --> FAQ --> then Question --> What is the fastest way of (not) logging?
@wing328 any update.?
I would suggest you to open a PR with swagger-parser and ask for more guidance there.