PHPackages                             ottosmops/consoleoutput - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. ottosmops/consoleoutput

ActiveLibrary[CLI &amp; Console](/categories/cli)

ottosmops/consoleoutput
=======================

Laravel Console Output Trait

v1.1.2(2y ago)1227MITPHPPHP &gt;=5.6.0CI failing

Since May 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ottosmops/consoleoutput)[ Packagist](https://packagist.org/packages/ottosmops/consoleoutput)[ Docs](https://github.com/ottosmops/consoleoutput)[ RSS](/packages/ottosmops-consoleoutput/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (5)Used By (0)

A trait to split Symfony/Laravel Console Output to stdout and stderr
====================================================================

[](#a-trait-to-split-symfonylaravel-console-output-to-stdout-and-stderr)

[![GitHub license](https://camo.githubusercontent.com/2437cb26612bc2880c16d1c8af07b96c92be9cd032b3a305ad9b97fd8defa225/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f74746f736d6f70732f636f6e736f6c656f75747075742e737667)](https://github.com/ottosmops/consoleoutput/blob/master/LICENSE.md)[![Latest Stable Version](https://camo.githubusercontent.com/c3c6c3fb72829d13c59faa7cdb141c5e297175a80676ce3911e82c2ecb9854a1/68747470733a2f2f706f7365722e707567782e6f72672f6f74746f736d6f70732f636f6e736f6c656f75747075742f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/ottosmops/consoleoutput)[![Packagist Downloads](https://camo.githubusercontent.com/31b7c5d15187c393726685c7d24da369239bf1fe6f08a7bd434d2f799a305c42/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f74746f736d6f70732f636f6e736f6c656f75747075742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ottosmops/consoleoutput)

A trait you can pull into your Laravel-Commands (`use \Ottosmops\Consoleoutput\ConsoleOutputTrait;`). This should help to make the commands behave more like you would expect ("Silence is golden."). The effect: Errors and warnings are sent to `stderr`. Other messages are sent to `stdout` ***only if*** you call the command with `-v`or `-vv`. You can overwrite this when you call the methods. Just set another `$verbosityLevel`.

The trait is inspired by this blog-post:

Installation
------------

[](#installation)

```
composer require ottosmops/consoleoutput
```

Usage
-----

[](#usage)

Just pull in the trait, and you are ready to go.

```
class TestCommand extents Illuminate\Console\Command
{
     use \Ottosmops\Consoleoutput\ConsoleOutputTrait;

     ...

     public function handle()
     {
        $this->info("This is only an info message."); // This message is only shown, if you call the command with '-v'.
        $this->error("Here comes the error.");
     }
}
```

Methods
-------

[](#methods)

```
debug($message, $verbosityLevel = 'vv')     // black output
info($message, $verbosityLevel = 'v')       // blue output
success($message, $verbosityLevel = 'v')    // green
warn($message, $verbosityLevel = 'normal')  // orange
error($message, $verbosityLevel = 'normal') // red
fatal($message, $verbosityLevel = 'normal') //red and exits
```

Version 1.1
-----------

[](#version-11)

To avoid errors, the methods check if you call them from the command line. Otherwise the Laravel-Log-Methods are called.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~709 days

Total

4

Last Release

787d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/76f31e7e6772db47a91388ed82840fae1fa57185bb82a64924bb3839697222c2?d=identicon)[ottosmops](/maintainers/ottosmops)

---

Top Contributors

[![ottosmops](https://avatars.githubusercontent.com/u/4144389?v=4)](https://github.com/ottosmops "ottosmops (15 commits)")

---

Tags

phpcliconsolesymfonylaraveloutputantonottosmops

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ottosmops-consoleoutput/health.svg)

```
[![Health](https://phpackages.com/badges/ottosmops-consoleoutput/health.svg)](https://phpackages.com/packages/ottosmops-consoleoutput)
```

###  Alternatives

[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.6k331.8M8.4k](/packages/nunomaduro-collision)[nunomaduro/laravel-console-menu

Laravel Console Menu is an output method for your Laravel/Laravel Zero commands.

815412.0k48](/packages/nunomaduro-laravel-console-menu)[nunomaduro/laravel-console-task

Laravel Console Task is a output method for your Laravel/Laravel Zero commands.

2582.1M11](/packages/nunomaduro-laravel-console-task)[nunomaduro/laravel-console-summary

A Beautiful Laravel Console Summary for your Laravel/Laravel Zero commands.

662.0M3](/packages/nunomaduro-laravel-console-summary)[nunomaduro/laravel-console-dusk

Laravel Console Dusk allows the usage of Laravel Dusk in Laravel/Laravel Zero artisan commands.

16255.4k7](/packages/nunomaduro-laravel-console-dusk)[rahul900day/laravel-console-spinner

Laravel Console Spinner is a spinner output for Laravel command line.

76125.4k1](/packages/rahul900day-laravel-console-spinner)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
