PHPackages                             imponeer/log-data-output-decorator - 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. imponeer/log-data-output-decorator

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

imponeer/log-data-output-decorator
==================================

Small decorator that extends Symfony OutputInterface delivered class with few options for easier to log data

v3.0.1(5mo ago)02501MITPHPPHP ^8.3CI passing

Since Feb 8Pushed 1w ago2 watchersCompare

[ Source](https://github.com/imponeer/log-data-output-decorator)[ Packagist](https://packagist.org/packages/imponeer/log-data-output-decorator)[ RSS](/packages/imponeer-log-data-output-decorator/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (4)Versions (14)Used By (1)

[![License](https://camo.githubusercontent.com/64bac136ee2f630514de036217d86857d846861f0db638a1e2028f2ed5417a4c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f696d706f6e6565722f6c6f672d646174612d6f75747075742d6465636f7261746f722e737667)](LICENSE) [![GitHub release](https://camo.githubusercontent.com/0c889ea2c3d74058a50d462c6d633d17b014bf2d5a0311697c6b2062bde24b67/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f696d706f6e6565722f6c6f672d646174612d6f75747075742d6465636f7261746f722e737667)](https://github.com/imponeer/log-data-output-decorator/releases) [![PHP](https://camo.githubusercontent.com/a6a6db9b4f7f039e6ad8eb6a4c2831f5fff99b9800df44a01c0b1b47d7038122/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f696d706f6e6565722f6c6f672d646174612d6f75747075742d6465636f7261746f722e737667)](http://php.net) [![Packagist](https://camo.githubusercontent.com/5f4f8dfe832a4090cc99d3ec1a388703f84f073e313304975bd45ba65400479c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f696d706f6e6565722f6c6f672d646174612d6f75747075742d6465636f7261746f722e737667)](https://packagist.org/packages/imponeer/log-data-output-decorator)

Log Data Output Decorator
=========================

[](#log-data-output-decorator)

A decorator that extends [Symfony OutputInterface](https://github.com/symfony/console/blob/7.x/Output/OutputInterface.php) with:

- Multiple message types: info, success, error, fatal, and plain messages
- Automatic indentation with indent control methods
- Parameter substitution using sprintf formatting
- Full Symfony OutputInterface compatibility

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

[](#installation)

Install via [Composer](https://getcomposer.org):

```
composer require imponeer/log-data-output-decorator
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
use Imponeer\Decorators\LogDataOutput\OutputDecorator;
use Symfony\Component\Console\Output\ConsoleOutput;

$output = new OutputDecorator(new ConsoleOutput());

// Different message types
$output->info('This is an info message');
$output->success('Operation completed successfully');
$output->error('An error occurred');
$output->fatal('Critical error - application stopping');
$output->msg('Plain message without formatting');
```

### Indentation Support

[](#indentation-support)

```
$output->info('Main process started');
$output->incrIndent();
$output->info('Sub-process 1');
$output->info('Sub-process 2');
$output->incrIndent();
$output->info('Nested sub-process');
$output->decrIndent();
$output->info('Back to sub-process level');
$output->resetIndent();
$output->info('Back to main level');
```

Output:

```
Main process started
  Sub-process 1
  Sub-process 2
    Nested sub-process
  Back to sub-process level
Back to main level

```

### Parameter Substitution

[](#parameter-substitution)

```
$output->info('Processing file: %s', 'example.txt');
$output->success('Processed %d files in %s seconds', 42, '1.23');
$output->error('Failed to process %s: %s', 'file.txt', 'Permission denied');
```

### Advanced Example

[](#advanced-example)

```
use Imponeer\Decorators\LogDataOutput\OutputDecorator;
use Symfony\Component\Console\Output\BufferedOutput;

$bufferedOutput = new BufferedOutput();
$output = new OutputDecorator($bufferedOutput);

$output->info('Starting batch process');
$output->incrIndent();

foreach (['file1.txt', 'file2.txt', 'file3.txt'] as $index => $file) {
    $output->info('Processing file %d: %s', $index + 1, $file);
    $output->incrIndent();

    if ($file === 'file2.txt') {
        $output->error('Failed to process %s', $file);
    } else {
        $output->success('Successfully processed %s', $file);
    }

    $output->decrIndent();
}

$output->resetIndent();
$output->info('Batch process completed');

// Get the formatted output
echo $bufferedOutput->fetch();
```

API Documentation
-----------------

[](#api-documentation)

Complete API documentation with all methods and examples is available in the [project wiki](https://github.com/imponeer/log-data-output-decorator/wiki), which is automatically generated from the source code.

Testing
-------

[](#testing)

Run the test suite:

```
composer test
```

Check code style compliance:

```
composer phpcs
```

Fix code style issues automatically:

```
composer phpcbf
```

Run static analysis:

```
composer phpstan
```

Contributing
------------

[](#contributing)

We welcome contributions! Here's how you can help:

1. **Fork the repository** on GitHub
2. **Create a feature branch** (`git checkout -b feature/amazing-feature`)
3. **Make your changes** and add tests if applicable
4. **Run the test suite** to ensure everything works
5. **Commit your changes** (`git commit -am 'Add amazing feature'`)
6. **Push to the branch** (`git push origin feature/amazing-feature`)
7. **Create a Pull Request**

### Development Guidelines

[](#development-guidelines)

- Follow PSR-12 coding standards
- Add tests for new functionality
- Update documentation for API changes
- Ensure all tests pass before submitting PR

### Reporting Issues

[](#reporting-issues)

Found a bug or have a suggestion? Please [open an issue](https://github.com/imponeer/log-data-output-decorator/issues) with:

- Clear description of the problem or suggestion
- Steps to reproduce (for bugs)
- Expected vs actual behavior
- PHP and Symfony Console versions

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance87

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 61.6% 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 ~175 days

Recently: every ~258 days

Total

11

Last Release

158d ago

Major Versions

v1.0.5 → v2.0.02023-02-03

v2.0.2 → v3.0.02025-06-26

PHP version history (3 changes)v1.0.0PHP &gt;=7.2

v2.0.0PHP &gt;=8.0.2

v3.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/dba53e399a507d1f60626164c8b1e340a5cc0dc4f0637f4c6aaff8fc239fdaee?d=identicon)[fiammybe](/maintainers/fiammybe)

![](https://www.gravatar.com/avatar/7255f306e0ca27292c50cdd9644c1c04e0d7b0f54bf35e0cdd79dc55c83b4923?d=identicon)[MekDrop](/maintainers/MekDrop)

![](https://www.gravatar.com/avatar/79009323fafcd4974bb1713b12eea0a610f01c4fb21cc5e85d446c4cb66453d4?d=identicon)[skenow](/maintainers/skenow)

---

Top Contributors

[![MekDrop](https://avatars.githubusercontent.com/u/342641?v=4)](https://github.com/MekDrop "MekDrop (45 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (23 commits)")[![Codex](https://avatars.githubusercontent.com/in/2248422?v=4)](https://github.com/Codex "Codex (2 commits)")[![fiammybe](https://avatars.githubusercontent.com/u/3736946?v=4)](https://github.com/fiammybe "fiammybe (2 commits)")[![mend-bolt-for-github[bot]](https://avatars.githubusercontent.com/in/16809?v=4)](https://github.com/mend-bolt-for-github[bot] "mend-bolt-for-github[bot] (1 commits)")

---

Tags

composer-librarydecoratorhacktoberfestsymfony-consoleconsolesymfonyoutputdecorator

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/imponeer-log-data-output-decorator/health.svg)

```
[![Health](https://phpackages.com/badges/imponeer-log-data-output-decorator/health.svg)](https://phpackages.com/packages/imponeer-log-data-output-decorator)
```

###  Alternatives

[nunomaduro/collision

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

4.6k331.8M8.4k](/packages/nunomaduro-collision)[matthiasnoback/symfony-console-form

Use Symfony forms for Console command input

368264.8k8](/packages/matthiasnoback-symfony-console-form)[contributte/console

Best Symfony Console for Nette Framework

983.6M49](/packages/contributte-console)[coresphere/console-bundle

This bundle allows you accessing the symfony2 console via your browser

146337.3k5](/packages/coresphere-console-bundle)[contributte/console-extra

Nette-based console commands for latte, DIC, security, utils and many others

301.2M2](/packages/contributte-console-extra)[phlib/console-process

Console implementation.

1833.5k2](/packages/phlib-console-process)

PHPackages © 2026

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