This repository has been archived by the owner. It is now read-only.

add colors to logs from ANSI control chars. #1103

Merged
merged 10 commits into from Aug 3, 2018

Conversation

Projects
None yet
3 participants
@snatchev
Contributor

snatchev commented Jul 25, 2018

  • I have run rspec and corrected all errors
  • I have run rubocop and corrected all errors
  • I have run npm run test and corrected all errors
  • I have tested this change locally and tried to launch the server as well as access a project, and with that at least one build

This PR adds colors to the logs by parsing out ANSI control chars:
image 1

@snatchev snatchev changed the title from add colors to logs from ANSI control chars. to [WIP] add colors to logs from ANSI control chars. Jul 25, 2018

@KrauseFx

So good 😍

Show outdated Hide outdated lib/ansi.rb

@snatchev snatchev changed the title from [WIP] add colors to logs from ANSI control chars. to add colors to logs from ANSI control chars. Jul 26, 2018

snatchev added some commits Jul 26, 2018

@nakhbari

This comment has been minimized.

Show comment
Hide comment
@nakhbari

nakhbari Jul 26, 2018

Contributor

Can we move this Ansi color library to the front-end? I think we should avoid html injection when possible.

Contributor

nakhbari commented Jul 26, 2018

Can we move this Ansi color library to the front-end? I think we should avoid html injection when possible.

@snatchev

This comment has been minimized.

Show comment
Hide comment
@snatchev

snatchev Jul 26, 2018

Contributor

@nakhbari I am in favor of moving it to the front-end. But I didn't know where to start, so I didn't do it there.

Contributor

snatchev commented Jul 26, 2018

@nakhbari I am in favor of moving it to the front-end. But I didn't know where to start, so I didn't do it there.

@nakhbari

This comment has been minimized.

Show comment
Hide comment
@nakhbari

nakhbari Jul 26, 2018

Contributor

@snatchev I'm more than happy to pair on this. I think it would take half a day.

Contributor

nakhbari commented Jul 26, 2018

@snatchev I'm more than happy to pair on this. I think it would take half a day.

@KrauseFx

This comment has been minimized.

Show comment
Hide comment
@KrauseFx

KrauseFx Jul 30, 2018

Member

Talking with @snatchev, not merging this until things are moved to frontend

Member

KrauseFx commented Jul 30, 2018

Talking with @snatchev, not merging this until things are moved to frontend

@KrauseFx

This comment has been minimized.

Show comment
Hide comment
@KrauseFx

KrauseFx Jul 30, 2018

Member

Related GH issue #1054

Member

KrauseFx commented Jul 30, 2018

Related GH issue #1054

@snatchev snatchev requested a review from nakhbari Jul 31, 2018

Show outdated Hide outdated web/app/common/components/log-viewer/log-line/log-line.component.ts
Show outdated Hide outdated web/app/common/components/log-viewer/log-line/log-line.component.ts
Show outdated Hide outdated web/app/common/components/log-viewer/log-line/log-line.component.ts
Show outdated Hide outdated web/app/common/components/log-viewer/log-line/log-line.component.ts
Show outdated Hide outdated web/app/common/components/log-viewer/log-line/log-line.component.ts
Show outdated Hide outdated web/app/common/components/log-viewer/log-line/log-line.component.ts
@@ -0,0 +1 @@

This comment has been minimized.

@nakhbari

nakhbari Jul 31, 2018

Contributor

can we add the background + color styles here?

i think it's this:


            padding: 8px;
            color: #93a1a1;
            background-color: #073642;
            font-family: 'Google Sans Monospace', monospace;
@nakhbari

nakhbari Jul 31, 2018

Contributor

can we add the background + color styles here?

i think it's this:


            padding: 8px;
            color: #93a1a1;
            background-color: #073642;
            font-family: 'Google Sans Monospace', monospace;
Show outdated Hide outdated web/app/common/components/log-viewer/log-viewer.component.spec.ts
const stack = this.tokenize(this.log.message);
for (const tuple of stack) {
const [code, text] = tuple;

This comment has been minimized.

@nakhbari

nakhbari Aug 3, 2018

Contributor

you can actually merge the previous two lines

for (const [ansiCode, text] of stack) { ... }
@nakhbari

nakhbari Aug 3, 2018

Contributor

you can actually merge the previous two lines

for (const [ansiCode, text] of stack) { ... }

This comment has been minimized.

@snatchev

snatchev Aug 3, 2018

Contributor

I tried... Typescript complained at me.

@snatchev

snatchev Aug 3, 2018

Contributor

I tried... Typescript complained at me.

@nakhbari

Looks Dope 🚢

@snatchev snatchev merged commit e42a223 into master Aug 3, 2018

4 checks passed

cla/google All necessary CLAs are signed
coverage/coveralls Coverage remained the same at 69.579%
Details
fastlane.ci: All rspecs pass All green
Details
fastlane.ci: All rubocops pass All green
Details

@snatchev snatchev deleted the add-ansi-colors-to-logs branch Aug 3, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.