Skip to content

Commit

Permalink
compiler: don't log compiled source (by deafault) (#781)
Browse files Browse the repository at this point in the history
* compiler: don't log compiled source (by deafault)

* changeset
  • Loading branch information
josephjclark authored Sep 25, 2024
1 parent 3e6eba2 commit 5db5862
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/little-hats-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@openfn/compiler': patch
'@openfn/cli': patch
'@openfn/worker': patch
---

Dont log compiled job code
7 changes: 5 additions & 2 deletions packages/compiler/src/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const defaultLogger = createLogger();

export type Options = TransformOptions & {
logger?: Logger;
logCompiledSource?: boolean;
};

export default function compile(pathOrSource: string, options: Options = {}) {
Expand All @@ -31,8 +32,10 @@ export default function compile(pathOrSource: string, options: Options = {}) {
const transformedAst = transform(ast, undefined, options);

const compiledSource = print(transformedAst).code;
logger.debug('Compiled source:');
logger.debug(compiledSource); // TODO indent or something
if (options.logCompiledSource) {
logger.debug('Compiled source:');
logger.debug(compiledSource); // TODO indent or something
}

return compiledSource;
}
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5db5862

Please sign in to comment.