Matrix Style Log Formatter #646

Closed
wants to merge 2 commits into
from

Conversation

6 participants
@no0p

no0p commented Jan 25, 2013

Overview

We all know that distributed programming is hard.

The current console logger is pretty handy, but for development info logging it's pretty tough to make sense of the output, after all there is only one STDOUT and many threads. -- and all the log messages are displayed sequentially.

This PR adds a new sidekiq config option:

:logformat: matrix

It uses a different logger formatter to print the single letters to STDOUT offet by the index of the current thread in Thread.list.

Example

                           i
d                           i
                           i
                           i
                 s
                 d
                    s
                    d
d                           d
dddd   s
d    s
dd     s
                    s
                 s
ddddddddddddddddd    d
dddd                           s
ddd                   d
    s
d     i
     d
                   s
                    i
                   i
                   d
     s
     d
                   s
                    d

This may not look like much to the untrained eye, but all I see is "success, failure, job milestone 1, etc"

I considered doing this much cooler in with curses, but since my project is Jruby that was not really an option.

@mperham

This comment has been minimized.

Show comment Hide comment
@mperham

mperham Jan 25, 2013

Owner

tables, are you high?

Owner

mperham commented Jan 25, 2013

tables, are you high?

@felipecsl

This comment has been minimized.

Show comment Hide comment
@felipecsl

felipecsl Jan 25, 2013

srsly :shipit:

srsly :shipit:

@jwo

This comment has been minimized.

Show comment Hide comment
@jwo

jwo Jan 25, 2013

@bdigital Please submit with a animated gif -> rails/rails#9001

jwo commented Jan 25, 2013

@bdigital Please submit with a animated gif -> rails/rails#9001

@no0p

This comment has been minimized.

Show comment Hide comment
@no0p

no0p Jan 25, 2013

matrix

no0p commented Jan 25, 2013

matrix

@mperham

This comment has been minimized.

Show comment Hide comment
@mperham

mperham Jan 25, 2013

Owner

Ok, that's seriously cool. Please optimize the line of code that creates the log message and I'll merge.

Owner

mperham commented Jan 25, 2013

Ok, that's seriously cool. Please optimize the line of code that creates the log message and I'll merge.

@ckuttruff

This comment has been minimized.

Show comment Hide comment
@ckuttruff

ckuttruff Jan 25, 2013

lol, this is amazing :shipit:

lol, this is amazing :shipit:

@no0p

This comment has been minimized.

Show comment Hide comment
@no0p

no0p Jan 25, 2013

@mperham sorry for the delay ... I had to make a sandwich. I was SO hungry.

Anyways the problem was somewhat less trivial than I expected. I had to increase the number of operations rather than decrease. This would probably only be used in development environments so hopefully it won't be too painful.

Also I'm pretty open to changing the implementation somewhat radically. No rush to merge.

no0p commented Jan 25, 2013

@mperham sorry for the delay ... I had to make a sandwich. I was SO hungry.

Anyways the problem was somewhat less trivial than I expected. I had to increase the number of operations rather than decrease. This would probably only be used in development environments so hopefully it won't be too painful.

Also I'm pretty open to changing the implementation somewhat radically. No rush to merge.

@nathanbertram

This comment has been minimized.

Show comment Hide comment
@nathanbertram

nathanbertram Feb 19, 2013

+1

@mperham

This comment has been minimized.

Show comment Hide comment
@mperham

mperham Mar 9, 2013

Owner

It's cool but I can't accept the additional complexity. :-(

Owner

mperham commented Mar 9, 2013

It's cool but I can't accept the additional complexity. :-(

@mperham mperham closed this Mar 9, 2013

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