Skip to content

Commit

Permalink
feat(hooks): forward hooks logs to debug logs (#8142)
Browse files Browse the repository at this point in the history
* feat(hooks): forward hooks logs to debug logs

* fix(cli): restore debug logs

* Create weak-plants-hang.md
  • Loading branch information
charlypoly committed Jul 26, 2022
1 parent 273ad60 commit cc18923
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/weak-plants-hang.md
@@ -0,0 +1,5 @@
---
"@graphql-codegen/cli": patch
---

feat(hooks): forward hooks logs to debug logs
4 changes: 3 additions & 1 deletion packages/graphql-codegen-cli/src/codegen.ts
Expand Up @@ -15,7 +15,7 @@ import { AggregateError } from '@graphql-tools/utils';
import { GraphQLError, GraphQLSchema, DocumentNode } from 'graphql';
import { getPluginByName } from './plugins.js';
import { getPresetByName } from './presets.js';
import { debugLog } from './utils/debugging.js';
import { debugLog, printLogs } from './utils/debugging.js';
import { CodegenContext, ensureContext, shouldEmitLegacyCommonJSImports } from './config.js';
import fs from 'fs';
import path from 'path';
Expand Down Expand Up @@ -415,5 +415,7 @@ export async function executeCodegen(input: CodegenContext | Types.Config): Prom
throw newErr;
}

printLogs();

return result;
}
1 change: 1 addition & 0 deletions packages/graphql-codegen-cli/src/hooks.ts
Expand Up @@ -59,6 +59,7 @@ function execShellCommand(cmd: string): Promise<string> {
if (error) {
reject(error);
} else {
debugLog(stdout || stderr);
resolve(stdout || stderr);
}
}
Expand Down

1 comment on commit cc18923

@vercel
Copy link

@vercel vercel bot commented on cc18923 Jul 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.