protected function configureLogger() {
        $appNoColor = strtoupper($this->config['composer']['extra']['name']) . '_NOCOLOR';

        if (array_key_exists('no-colors', $this->config['options']) ||
            getenv('NO_COLOR') !== false ||
            getenv($appNoColor) !== false ||
            (function_exists('posix_isatty') && posix_isatty(STDOUT) === false)) {
            $this->config['log']['colorize'] = false;
        }

        $this->log->printColors($this->config['log']['colorize']);

        if (array_key_exists('q', $this->config['options']) ||
            array_key_exists('quiet', $this->config['options'])) {
            $this->config['log']['verbosity'] = Log::FATAL | Log::ERROR;
        } elseif (array_key_exists('v', $this->config['options']) ||
            array_key_exists('verbose', $this->config['options'])) {
            $this->config['log']['verbosity'] = Log::ALL;
        }

        $this->log->setVerbosity($this->config['log']['verbosity']);

        return $this;
    }
protected function configureLogger() {
        $appNoColor = strtoupper($this->config['composer']['extra']['name']) . '_NOCOLOR';

        if (array_key_exists('no-colors', $this->config['options']) ||
            getenv('NO_COLOR') !== false ||
            getenv($appNoColor) !== false ||
            (function_exists('posix_isatty') && posix_isatty(STDOUT) === false)) {
            $this->config['log']['colorize'] = false;
        }

        $this->log->printColors($this->config['log']['colorize']);

        if (array_key_exists('q', $this->config['options']) ||
            array_key_exists('quiet', $this->config['options'])) {
            $this->config['log']['verbosity'] = Log::FATAL | Log::ERROR;
        } elseif (array_key_exists('v', $this->config['options']) ||
            array_key_exists('verbose', $this->config['options'])) {
            $this->config['log']['verbosity'] = Log::ALL;
        }

        $this->log->setVerbosity($this->config['log']['verbosity']);

        return $this;
    }
protected function configureLogger ( ) { $ appNoColor = strtoupper ( $ this -> config [ 'composer' ] [ 'extra' ] [ 'name' ] ) . '_NOCOLOR' ; if ( array_key_exists ( 'no-colors' , $ this -> config [ 'options' ] ) || getenv ( 'NO_COLOR' ) !== false || getenv ( $ appNoColor ) !== false || ( function_exists ( 'posix_isatty' ) && posix_isatty ( STDOUT ) === false ) ) { $ this -> config [ 'log' ] [ 'colorize' ] = false ; } $ this -> log -> printColors ( $ this -> config [ 'log' ] [ 'colorize' ] ) ; if ( array_key_exists ( 'q' , $ this -> config [ 'options' ] ) || array_key_exists ( 'quiet' , $ this -> config [ 'options' ] ) ) { $ this -> config [ 'log' ] [ 'verbosity' ] = Log :: FATAL | Log :: ERROR ; } elseif ( array_key_exists ( 'v' , $ this -> config [ 'options' ] ) || array_key_exists ( 'verbose' , $ this -> config [ 'options' ] ) ) { $ this -> config [ 'log' ] [ 'verbosity' ] = Log :: ALL ; } $ this -> log -> setVerbosity ( $ this -> config [ 'log' ] [ 'verbosity' ] ) ; return $ this ; }
Set color handling and verbosity for used logger

Respect environment variables
- "NO_COLOR" (@see https://no-color.org/) and
- "<App name in upper case>_NOCOLOR"
regardless of their values

Also, disable colors if there is no TTY available
(for example, then output is piped to another app)

@return self Returns itself
Set color handling and verbosity for used logger