Skip to content

Commit ee2d20b

Browse files
committed
disable emoticons when colors are disabled
1 parent 4b24a8c commit ee2d20b

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/CLI.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ public function log($level, $message, array $context = array())
280280
/** @var string $color */
281281
/** @var resource $channel */
282282
list($prefix, $color, $channel) = $this->loglevel[$level];
283+
if(!$this->colors->isEnabled()) $prefix = '';
283284

284285
$message = $this->interpolate($message, $context);
285286
$this->colors->ptln($prefix . $message, $color, $channel);

src/Colors.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ public function disable()
8888
$this->enabled = false;
8989
}
9090

91+
/**
92+
* @return bool is color support enabled?
93+
*/
94+
public function isEnabled()
95+
{
96+
return $this->enabled;
97+
}
98+
9199
/**
92100
* Convenience function to print a line in a given color
93101
*

0 commit comments

Comments
 (0)