Skip to content

Commit

Permalink
clean up logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Omar Rida authored and Omar Rida committed Mar 20, 2024
1 parent 28fada5 commit 74fd632
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions generators/openapi/src/generatorLoggingWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export class GeneratorLoggingWrapper {
};

constructor(generatorConfig: FernGeneratorExec.GeneratorConfig) {
// eslint-disable-next-line no-console
console.log("generatorConfig", JSON.stringify(generatorConfig));
if (generatorConfig.environment.type === "remote") {
// eslint-disable-next-line no-console
console.log("generatorConfig.environment.coordinatorUrlV2", generatorConfig.environment.coordinatorUrlV2);
Expand Down
12 changes: 6 additions & 6 deletions generators/openapi/src/writeOpenApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function writeOpenApi(mode: Mode, pathToConfig: string): Promise<vo
const customConfig = getCustomConfig(config);

// eslint-disable-next-line no-console
console.log("customConfig", customConfig);
console.log("customConfig", JSON.stringify(customConfig));
const generatorLoggingClient = new GeneratorLoggingWrapper(config);

try {
Expand All @@ -39,18 +39,18 @@ export async function writeOpenApi(mode: Mode, pathToConfig: string): Promise<vo
console.log("loading ir");
const ir = await loadIntermediateRepresentation(config.irFilepath);
// eslint-disable-next-line no-console
console.log("parsed ir", ir);
console.log("parsed ir", JSON.stringify(ir));
const openApiDefinition = convertToOpenApi({
apiName: config.workspaceName,
ir,
mode
});
// eslint-disable-next-line no-console
console.log("openApiDefinition", openApiDefinition);
console.log("openApiDefinition", JSON.stringify(openApiDefinition));

const openApiDefinitionWithCustomOverrides = merge(customConfig.customOverrides, openApiDefinition);
// eslint-disable-next-line no-console
console.log("openApiDefinitionWithCustomOverrides", openApiDefinitionWithCustomOverrides);
console.log("openApiDefinitionWithCustomOverrides", JSON.stringify(openApiDefinitionWithCustomOverrides));

if (customConfig.format === "json") {
// eslint-disable-next-line no-console
Expand Down Expand Up @@ -97,10 +97,10 @@ export async function writeOpenApi(mode: Mode, pathToConfig: string): Promise<vo
async function loadIntermediateRepresentation(pathToFile: string): Promise<IntermediateRepresentation> {
const irString = (await readFile(pathToFile)).toString();
// eslint-disable-next-line no-console
console.log("irString", irString);
console.log("irString", JSON.stringify(irString));
const irJson = JSON.parse(irString);
// eslint-disable-next-line no-console
console.log("irJson", irJson);
console.log("irJson", JSON.stringify(irJson));
// eslint-disable-next-line no-console
console.log("parsing ir");
return IrSerialization.IntermediateRepresentation.parseOrThrow(irJson);
Expand Down

0 comments on commit 74fd632

Please sign in to comment.