Skip to content
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

Option to disable output of running task name #895

Closed
binarykitchen opened this issue Sep 11, 2013 · 4 comments
Closed

Option to disable output of running task name #895

binarykitchen opened this issue Sep 11, 2013 · 4 comments
Milestone

Comments

@binarykitchen
Copy link

I've been looking for a long time for a grunt option to silence some default logging.

An option to disable the output of running tasks names would be great. Especially when I want to run karma e2e tests that generates an output only when a test fails.

At the moment I see lines like these:

Running "karma:e2e_single" (karma) task

Every grunt task begins with such an output. How can I disable them? To me it looks like there is no such option. Can you add one?

@shama
Copy link
Member

shama commented Sep 11, 2013

You'll be able to easily customize this in the next version of Grunt. If you want to check out the progress please view: https://github.com/cowboy/node-prolog

A simple workaround for now is to just duck punch grunt.log.header = function() {} in your Gruntfile.

@shama shama closed this as completed Sep 11, 2013
@binarykitchen
Copy link
Author

sweet, thx

@radkodinev
Copy link

This might be useful to sombedy so I'll share my twisted hack which should work for most Unix/Linux terminals :)

I have written a simple task for my own usage which I run multiple times as part of a bigger task. I do not want Running "blah" task output to be seen right above the actual output so in my task's code I did:

  grunt.log.write("\x1B[1A");
  grunt.log.writeln(actualTaskOutput);

The first line outputs the ANSI escape sequence for vt100 terminals to move the cursor 1 line up and then the next write actually overwrites overwrites the Running "blah" task text (provided that you output a long enough string) ;)

Edit:
You could also move the cursor one line up ("\x1B[1A"), just clear the entire line ("\x1B[2K"), possibly write some output on it and a new line (grunt.log.writeln('some output on it') or just grunt.log.writeln()) and then start writing the task output.

@stevenvachon
Copy link

https://github.com/stevenvachon/grunt-log-headers

Also works in Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants