Open nahkampf opened 6 years ago
Thanks for the report @nahkampf , yes, this is a bug introduced by me in https://github.com/wp-cli/php-cli-tools/pull/107 where Streams::render()
no longer strips the color percent codes if Colors::shouldColorize()
is not true, so sprintf()
complains about them and (worse) doesn't output correctly.
This in turn was prompted by not wanting percent codes to be stripped when printing standard data.
So a bit of a mess really, and not sure there's a way to accommodate both issues.
A workaround is to just colorize oneself, eg
\cli\line(\cli\Colors::colorize("[%C%k%s%N] Starting!"), date("Y-m-d H:i:s"));
but this is obviously a bit yuck. Will consider the problem further to see if there's a solution...
Ah, thanks! Yucky workaround but I'll take it :)
Can't really figure this one out. Sometimes (not often, but often enough to end up in my logs and irritate me) \cli\line() causes a warning: sprintf(): Too few arguments.
This is the offending line:
Can't really see how the argument to sprintf() gets lost here, but obv it does.
environment: php5.6.33 (with mbstring) on debian, php-cli-tools v0.11.8.
Logfile trace: