Skip to content

Commit 2989315

Browse files
committed
chore(codegen): replace print with logging
1 parent 932d54e commit 2989315

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

codegen/CustomCSharpNetCoreClientCodegen.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
import org.openapitools.codegen.languages.*;
33
import org.openapitools.codegen.utils.ProcessUtils;
44
import com.google.common.base.CaseFormat;
5+
import org.slf4j.Logger;
6+
import org.slf4j.LoggerFactory;
57

68
import java.io.File;
79

810
public class CustomCSharpNetCoreClientCodegen extends CSharpNetCoreClientCodegen {
9-
11+
private static final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class);
12+
1013
@Override
1114
public void processOpts() {
1215
super.processOpts();
@@ -17,12 +20,11 @@ public void processOpts() {
1720
File folder = new File(templateDir);
1821
File[] files = folder.listFiles();
1922
if (files != null) {
20-
System.out.println("Adding below custom templates");
2123
for (File file : files) {
2224
if(supportingFiles.stream().filter(f -> f.templateFile.equals(file.getName())).findFirst().isPresent()) {
2325
continue;
2426
}
25-
System.out.println(file.getName());
27+
LOGGER.info("adding custom template file {}", file.getName());
2628
if (file.getName().endsWith("_doc.mustache")) {
2729
String outFilename = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, file.getName().substring(0, file.getName().indexOf("_doc.mustache"))) + ".md";
2830
supportingFiles.add(new SupportingFile(file.getName(), apiDocPath, outFilename));

codegen/CustomPythonClientCodegen.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
import org.openapitools.codegen.languages.*;
33
import org.openapitools.codegen.utils.ProcessUtils;
44
import com.google.common.base.CaseFormat;
5+
import org.slf4j.Logger;
6+
import org.slf4j.LoggerFactory;
57

68
import java.io.File;
79

810
public class CustomPythonClientCodegen extends PythonClientCodegen {
9-
11+
private static final Logger LOGGER = LoggerFactory.getLogger(PythonClientCodegen.class);
12+
1013
@Override
1114
public void processOpts() {
1215
super.processOpts();
@@ -16,12 +19,11 @@ public void processOpts() {
1619
File folder = new File(templateDir);
1720
File[] files = folder.listFiles();
1821
if (files != null) {
19-
System.out.println("Adding below custom templates");
2022
for (File file : files) {
2123
if(supportingFiles.stream().filter(f -> f.templateFile.equals(file.getName())).findFirst().isPresent()) {
2224
continue;
2325
}
24-
System.out.println(file.getName());
26+
LOGGER.info("adding custom template file {}", file.getName());
2527
if (file.getName().endsWith("_doc.mustache")) {
2628
String outFilename = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, file.getName().substring(0, file.getName().indexOf("_doc.mustache"))) + ".md";
2729
supportingFiles.add(new SupportingFile(file.getName(), apiDocPath, outFilename));

0 commit comments

Comments
 (0)