weixin_39615643
weixin_39615643
2020-11-22 02:08

Add option to prepend each line of the output with the taske name

adds support for a new config option logTaskName. When set to true and used together with logConcurrentOutput it will prepend the taskname in a task specific color to each line of output with a default maximum of 12 chars. When logTaskName is a number, it will be used as the maximum number of chars to be used for the taskname.

In the example below, the concurrent tasks "webpack:dev" and "exec:dev" are prepended with their name and their own color with logTaskName=3 (max 3 chars) image

该提问来源于开源项目:sindresorhus/grunt-concurrent

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

9条回答

  • weixin_39615643 weixin_39615643 5月前

    hey, this is my first pull request ever .. written plenty of code, just never had to .. I see stuff about linebreaks not being LF but CRLF, not sure what that means. Let me know if it needs fixing

    点赞 评论 复制链接分享
  • weixin_39603609 weixin_39603609 5月前

    I'm ok with adding this, but needs some docs.

    点赞 评论 复制链接分享
  • weixin_39603609 weixin_39603609 5月前

    Just ignore the lint errors. I haven't updated the codebase to be compatible yet. I'll do it after merging this :)

    点赞 评论 复制链接分享
  • weixin_39615643 weixin_39615643 5月前

    Ok, I added the requested changes and added information to the documentation. I used String.prototype.repeat, which is Ecmascript 2015, which should be fine right?

    点赞 评论 复制链接分享
  • weixin_39615643 weixin_39615643 5月前

    alright, all done

    点赞 评论 复制链接分享
  • weixin_39603609 weixin_39603609 5月前

    Can you add a test task to https://github.com/sindresorhus/grunt-concurrent/blob/master/gruntfile.js so I can just run it to manually verify that it works.

    点赞 评论 复制链接分享
  • weixin_39603609 weixin_39603609 5月前

    Ping :)

    点赞 评论 复制链接分享
  • weixin_39901412 weixin_39901412 5月前

    created a new PR with your fixed suggestions : https://github.com/sindresorhus/grunt-concurrent/pull/99

    This feature can be really useful to understand why some watched processes are triggered (particularly when chaining watches)

    点赞 评论 复制链接分享
  • weixin_39603609 weixin_39603609 5月前

    Closing in favor of https://github.com/sindresorhus/grunt-concurrent/pull/99

    点赞 评论 复制链接分享

相关推荐