Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show multi-line logs properly. #254

Closed
rudolfbyker opened this issue Apr 21, 2021 · 0 comments · Fixed by #255
Closed

Show multi-line logs properly. #254

rudolfbyker opened this issue Apr 21, 2021 · 0 comments · Fixed by #255

Comments

@rudolfbyker
Copy link

Example code:

new Worker(
  "myQueue",
  async (job) => {
    const result = spawnSync(
      "rsync",
      [
        "--times",
        "--verbose",
        "--compress",
        "--dry-run",
        "--itemize-changes",
        "--relative",
        job.data.fileName,
        "user@host:/web/",
      ],
      {
        encoding: "utf8",
      }
    );
    await job.log(result.stdout);
  }
)

What the logs look like:
image

What the logs probably should look like (sort-of):

cd+++++++++ comment/
<f+++++++++ comment/3.html

sent 71 bytes
received 22 bytes
62.00 bytes/sec total
size is 193,260
speedup is 2,078.06 (DRY RUN)

I also tried this, but it does not help:

await job.log(`<pre>${result.stdout}</pre>`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant