0

Via GitLab log API /projects/:id/jobs/:job_id/trace, I got the log content like below:

[0KRunning with gitlab-runner 14.10.0~beta.50.g1f2fe53e (1f2fe53e)[0;m
[0K  on blue-5.shared.runners-manager.gitlab.com/default -AzERasQ[0;m
section_start:1652284543:prepare_executor
[0K[0K[36;1mPreparing the "docker+machine" executor[0;m[0;m
[0KUsing Docker executor with image ruby:2.5 ...[0;m

and the finial render result should be like:

enter image description here

my question is:

what kind of this log?

how to read or render it use javascript or swift? has any library?

Dakin
  • 1
  • 1
  • It's using https://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux It's unclear where you need to "render" them, if they accept coloring text, if so, what's the protocol, if not, you might need to remove the coloring tags... – Larme May 12 '22 at 11:35
  • @Larme thank you, do not need the color, Just need to remove some leading and trailing characters, `[OK` `[36;1m` `[0;m`, have any idea ? – Dakin May 12 '22 at 11:48
  • Now that you have the name of the tags (ansi color), a quick search: https://stackoverflow.com/questions/25245716/remove-all-ansi-colors-styles-from-strings – Larme May 12 '22 at 11:56

0 Answers0