Skip to content

Commit

Permalink
logger: serialise print() properly
Browse files Browse the repository at this point in the history
  • Loading branch information
josephjclark committed Jan 31, 2024
1 parent 1313b09 commit 63a251a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions integration-tests/cli/test/metadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ test.before(async () => {
});

// Generate metadata
test.serial(
test.serial.only(
`openfn metadata -S "${state}" -a test=${modulePath} --log-json --log info`,
async (t) => {
const { stdout } = await run(t.title);

t.regex(stdout, /Generating metadata/);
t.regex(stdout, /Metadata function found. Generating metadata/);
t.notRegex(stdout, /Returning metadata from cache/);
Expand Down
2 changes: 1 addition & 1 deletion packages/logger/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export default function (name?: string, options: LogOptions = {}): Logger {
const print = (...args: any[]) => {
if (opts.level !== NONE) {
if (opts.json) {
emitter.info(JSON.stringify({ message: args }));
emitter.info({ message: args });
} else {
emitter.info(...args);
}
Expand Down

0 comments on commit 63a251a

Please sign in to comment.