Giter Club home page Giter Club logo

Comments (8)

krancour avatar krancour commented on August 11, 2024 1

What if we just used a dedicated color for the messages from the controller and removed that color from the pool used for the other processes?

from workflow-cli.

Joshua-Anderson avatar Joshua-Anderson commented on August 11, 2024

Right now, we add the integer value of all the characters in the process title and divide by the number of colors, taking the remainder as the selected color.

It's a very simple, but very stupid solution.

In this situation, the integer value of the sum of the characters for both the controller process type and the other process type have the same remainder, giving them the same color. In order to prevent this, we would need to stop using this algorithm and instead would need to save all the process titles in the output and their assigned color to prevent repeats to the greatest possible degree.

from workflow-cli.

bacongobbler avatar bacongobbler commented on August 11, 2024

because then we're adding client-level implementation details into the API response. If someone were to extend the API in another language or in an environment where pretty colors are not important, that data would be useless.

fwiw Heroku colors their logs based on the process type and process number as well (e.g. web.1 would be different than web.3 in most cases). Color collisions mostly occur due to the lack of colors a TTY provides (8 + default uncolored text). If we had a full color spectrum then this wouldn't occur very often, if at all.

from workflow-cli.

krancour avatar krancour commented on August 11, 2024

because then we're adding client-level implementation details into the API response. If someone were to extend the API in another language or in an environment where pretty colors are not important, that data would be useless.

afaik, this doesn't involve touching the API at all. Colorizing is done entirely by the CLI. I'm suggesting that we could us a regex, perhaps, to distinguish log messages originating from the controller from those originating from application processes. By doing that, we could reserve a dedicated color for the controller.

imo, the logs originating from the controller are special because they are indicative of administrative functions that have been performed upon the app. I think it's important that those not get "lost" in a sea of logs viewed via the client.

from workflow-cli.

krancour avatar krancour commented on August 11, 2024

Colorizing is done entirely by the CLI.

Or have I got that wrong? I'm questioning it now.

from workflow-cli.

bacongobbler avatar bacongobbler commented on August 11, 2024

No, you've got it right. prettyprint is the package we use to colorize the logs. All done on the client side. :)

By doing that, we could reserve a dedicated color for the controller.

That would be a happy medium. Just reserve one of the 8 colors for the controller, then use the rest of the color wheel for the application logs. That way the controller is guaranteed to be different from the rest.

I vote for Magenta 😉

afaik, this doesn't involve touching the API at all.

Sorry, I was responding to

What if we just used a dedicated color for the messages from the controller and removed that color from the pool used for the other processes?

And thought you meant literally attaching a color code to the log and shipping that in the response. I mis-interpreted your proposal. My bad! :)

from workflow-cli.

krancour avatar krancour commented on August 11, 2024

No worries. And I like magenta. 👍

from workflow-cli.

Joshua-Anderson avatar Joshua-Anderson commented on August 11, 2024

I opened PR #132 to fix this.

from workflow-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.