Skip to content

Commit

Permalink
Merge pull request #1304 from PetrChalov/fix_log_err
Browse files Browse the repository at this point in the history
Runner: log runner error through util.inspect
  • Loading branch information
icebob authored Oct 17, 2024
2 parents df56be1 + 83bcde6 commit 7c4846d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/runner-esm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import utils from "./utils.js";
import fs from "fs";
import path from "path";
import { createRequire } from "module";
import { inspect } from "util";
import glob from "glob";
import _ from "lodash";
import Args from "args";
Expand Down Expand Up @@ -47,7 +48,7 @@ const logger = {
error(err) {
if (err instanceof Error)
console.error(kleur.grey("[Runner]"), kleur.red().bold(err.message), err);
else console.error(kleur.grey("[Runner]"), kleur.red().bold(err));
else console.error(kleur.grey("[Runner]"), kleur.red().bold(inspect(err)));
}
};

Expand Down
3 changes: 2 additions & 1 deletion src/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const utils = require("./utils");
const fs = require("fs");
const path = require("path");
const glob = require("glob").sync;
const inspect = require("util").inspect;
const _ = require("lodash");
const Args = require("args");
const os = require("os");
Expand Down Expand Up @@ -44,7 +45,7 @@ const logger = {
error(err) {
if (err instanceof Error)
console.error(kleur.grey("[Runner]"), kleur.red().bold(err.message), err);
else console.error(kleur.grey("[Runner]"), kleur.red().bold(err));
else console.error(kleur.grey("[Runner]"), kleur.red().bold(inspect(err)));
}
};

Expand Down

0 comments on commit 7c4846d

Please sign in to comment.