-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unconventional output when executed via rake or guard-jasmine #133
Unconventional output when executed via rake or guard-jasmine #133
Conversation
Whether the output has the timestamp or not is a question of using the Guard provided UI helper or not. Since guard-rspec just delegates the work to RSpec, which in turn just writes to stdout through a formatter, it doesn't have the Guard logger timestamps. Guard-Jasmine itself doesn't make use of an external tool and uses the UI helpers, so all its output is configurable by Guard. To change this you have basically two options:
I hope that helps. |
Thanks for the detailed response. I'm happy to submit a pull request once I know you're okay with the change. The A fix would look roughly like: detect when guard-jasmine has been invoked via guard, and follow the existing code path. When not run by guard (i.e. rake or direct on the command line), bypass guard's logging facility or tweak its configuration so that the timestamp and level are not displayed. If that sounds reasonable, I'll look for a clean way to implement it. |
Good point, I always forget about this.
A very simple fix is to just configure the logger options in lib/guard/jasmine/cli.rb, e.g. ::Guard::UI.options = ::Guard::UI.options.merge({ :template => ':message' }) or even make the logger template a simple string option for the command line with a default.
That would be great! |
…nd log level so that our output looks more like other commands.
Your "very simple fix" works fantastically. If excluding the timestamps and log level for the CLI is okay with you (it's perfect for me), I don't think there's really a simpler solution. I personally have a hard time imagining someone using a command-line option to change the log format. |
Absolutely, I think no one needs to see a timestamp on the CI server for Guard:Jasmine. We need to provide sensible defaults and not a configuration option more to confuse the users completely. |
Oops, how could I forget about this? Finally merged and will release today. Thanks a lot! |
This is a very minor issue, and possibly, more of a question than anything serious.
The output from guard-jasmine is unconventional when run via the command line (
guard-jasmine
) or the rake task. By unconventional, I'm specifically referring to the timestamps and INFO log level.That output style is consistent with what you see when running guard, but it stands out a bit outside of guard. To be clear, I would expect to see:
In my experience, most guard plugins don't include the timestamps and log level in the output of commands they execute. For example,
guard-rspec
doesn't add timestamps to the output of rspec.I admit it's a cosmetic thing at worst. Regardless, are you opposed to a) dropping the timestamps and log level or b) conditionally displaying them only when run from within guard? If not, I'll try to put together a pull request for you.
Thanks!
Christian