gajus / turbowatch

Extremely fast file change detector and task orchestrator for Node.js.
Other
938 stars 23 forks source link

throttle logs #7

Closed gajus closed 1 year ago

gajus commented 1 year ago

It is a bit annoying how when you have multiple watch commands running at once, the logs from the different processes keep switching places every other line.

contra-redis:dev: 973191cf > #5 sha256:7f65636102fd1f499092cb075baa95784488c0bbc3e0abff2a6d853109e4a948 4.19MB / 9.60MB 22.3s
contra-redis:dev: 973191cf > #5 sha256:d01ec855d06e16385fb33f299d9cc6eb303ea04378d0eea3a75d74e26c6e6bb9 0B / 1.39MB 22.7s
contra-api:dev: a1e4c6a7 > [18:48:37.171] 765ms debug @@contra/utilities #waitFor: Waiting for database to be ready...
contra-api:dev: a1e4c6a7 > [18:48:37.225]  54ms debug @@contra/utilities #waitFor: Waiting for Redis to be ready...
contra-temporal-job-worker:dev: 2fb02d72 > [18:48:37.313]  88ms debug @@contra/utilities #waitFor: Waiting for database to be ready...
contra-temporal-job-worker:dev: 2fb02d72 > [18:48:37.408]  95ms debug @@contra/utilities #waitFor: Waiting for Redis to be ready...
contra-redis:dev: 973191cf > #5 sha256:7f65636102fd1f499092cb075baa95784488c0bbc3e0abff2a6d853109e4a948 5.24MB / 9.60MB 22.9s
contra-redis:dev: 973191cf > #5 sha256:7f65636102fd1f499092cb075baa95784488c0bbc3e0abff2a6d853109e4a948 6.29MB / 9.60MB 23.7s
contra-api:dev: a1e4c6a7 > [18:48:38.172] 764ms debug @@contra/utilities #waitFor: Waiting for database to be ready...
contra-api:dev: a1e4c6a7 > [18:48:38.227]  55ms debug @@contra/utilities #waitFor: Waiting for Redis to be ready...

It is correct, but given that these logs are not particularly time sensitive, it would look cleaner if throttled them a bit, which would make them grouped, e.g. the above would become:

contra-redis:dev: 973191cf > #5 sha256:7f65636102fd1f499092cb075baa95784488c0bbc3e0abff2a6d853109e4a948 4.19MB / 9.60MB 22.3s
contra-redis:dev: 973191cf > #5 sha256:d01ec855d06e16385fb33f299d9cc6eb303ea04378d0eea3a75d74e26c6e6bb9 0B / 1.39MB 22.7s
contra-redis:dev: 973191cf > #5 sha256:7f65636102fd1f499092cb075baa95784488c0bbc3e0abff2a6d853109e4a948 5.24MB / 9.60MB 22.9s
contra-redis:dev: 973191cf > #5 sha256:7f65636102fd1f499092cb075baa95784488c0bbc3e0abff2a6d853109e4a948 6.29MB / 9.60MB 23.7s
contra-api:dev: a1e4c6a7 > [18:48:37.171] 765ms debug @@contra/utilities #waitFor: Waiting for database to be ready...
contra-api:dev: a1e4c6a7 > [18:48:37.225]  54ms debug @@contra/utilities #waitFor: Waiting for Redis to be ready...
contra-api:dev: a1e4c6a7 > [18:48:38.172] 764ms debug @@contra/utilities #waitFor: Waiting for database to be ready...
contra-api:dev: a1e4c6a7 > [18:48:38.227]  55ms debug @@contra/utilities #waitFor: Waiting for Redis to be ready...
contra-temporal-job-worker:dev: 2fb02d72 > [18:48:37.313]  88ms debug @@contra/utilities #waitFor: Waiting for database to be ready...
contra-temporal-job-worker:dev: 2fb02d72 > [18:48:37.408]  95ms debug @@contra/utilities #waitFor: Waiting for Redis to be ready...
github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 1.6.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: