PHPackages                             mpakfm/printu - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. mpakfm/printu

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

mpakfm/printu
=============

Simple logger.

2.0.1(1y ago)13.0k—8.9%1MITPHPPHP &gt;=7.0.0

Since Jan 8Pushed 1y agoCompare

[ Source](https://github.com/mpakfm/printu)[ Packagist](https://packagist.org/packages/mpakfm/printu)[ RSS](/packages/mpakfm-printu/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (10)Used By (1)

printu
======

[](#printu)

Simple Logger
=============

[](#simple-logger)

**version 2.0.0**

- add log levels: \[debug, info, warning, alert\]
- add notifications (email)

Configuration:

```
Printu::setConfNotifier([
    'warning' => 'email',
    'alert'   => 'email',
]);
Printu::setConfChannel([
    'email' => ['some@email.com', 'another@email.com']
]);
Printu::$fromNotifier = 'no-reply@server';
Printu::$subjNotifier = 'Some project';
```

Usage:

```
$var = ['asd', 'fgh'];
Printu::debug($var);
Printu::info($var)->title('INFO $var');
Printu::warning($var)->title('WARNING $var');
Printu::alert($var)->title('ALERT $var');
```

Log files:

debug.log

```
Array
(
    [0] => asd
    [1] => fgh
)

```

info.log

```
24.05 18:54:35	INFO $var: Array
(
    [0] => asd
    [1] => fgh
)

```

warning.log

```
24.05 18:54:35	WARNING $var: Array
(
    [0] => asd
    [1] => fgh
)

```

alert.log

```
24.05 18:55:35	ALERT $var: Array
(
    [0] => asd
    [1] => fgh
)

```

email subject:

```
{Printu::$subjNotifier} {level} {title}:

```

email example:

```
From hp440 Tue May 24 19:13:42 2022
Return-Path:
Received: (from hp440@localhost)
	by hp440 (8.15.2/8.15.2/Submit) id 24OGDgaT3370909;
	Tue, 24 May 2022 19:13:42 +0300
Date: Tue, 24 May 2022 19:13:42 +0300
Message-Id:
To: some@email.com
Subject: Some project warning WARNING $var
From: no-reply@server
X-Mailer: PHP/7.4.29

24.05 19:12:42	WARNING $var: Array
(
    [0] => asd
    [1] => fgh
)

```

**version 1.2.3**

- bug-fix in method show()
- add method error() for default set datetime and file error.log

**version 1.2.2**

Response types:

- var - return as a string variable
- file - print in the log file as plain text, **set as default now**
- text - print in STDOUT as plain text
- html - print in STDOUT as html

Default response type is "file"

You can change default response type by this method:

```
public static function setDefaultResponse(string $response): bool {}
```

Set path to save log files:

```
public static function setPath(string $path=''): bool {}
```

For example:

some index.php

```
Printu::setPath(__DIR__.'/var/log');
Printu::setDefaultResponse('html');
```

some some.php

```
Printu::obj($_POST)->title('POST');
```

**version 1.2**

New samples:

```
Printu::setPath(__DIR__ . '/var/log');

Printu::obj('-----')->response('file')->show();

$dt = new \DateTime();
$dt->sub(new \DateInterval('P1MT10H'));
Printu::obj('test')->title('IndexController::index')->dt($dt)->response('file')->show();

Printu::obj('test H:i:s in log file info.log')->dt()->timeFormat('H:i:s')->response('file')->show();

Printu::obj('test in log file error.log')->response('file')->file('error')->show();

Printu::obj('test echo')->show();
```

tail -f var/log/info.log:

```
-----
01.06 13:50:13  IndexController::index: test
23:31:08        test H:i:s in log file info.log

```

tail -f var/log/error.log:

```
-----
test in log file error.log

```

Old version samples:

```
Printu::setPath(__DIR__ . '/var/log');

$dt = new \DateTime();
$dt->sub(new \DateInterval('P1MT10H'));
Printu::log('-------', '', 'file');
Printu::log('test', $dt->format('d.m H:i:s')."\t".'IndexController::index', 'file');
Printu::log('test in log file info.log', 'IndexController::index', 'file');
Printu::log('test in log file error.log', 'IndexController::index', 'file', 'error.log');
```

tail -f var/log/info.log:

```
-------
01.06 13:58:20  IndexController::index: test
IndexController::index: test in log file info.log

```

tail -f var/log/error.log:

```
IndexController::index: test in log file error.log

```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

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 ~256 days

Recently: every ~377 days

Total

9

Last Release

683d ago

Major Versions

1.2.3 → 2.0.02022-05-24

PHP version history (2 changes)1.0.2PHP &gt;=5.3.0

1.1.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/66adc2cf20b1763bfb2061c9522e32ba123d6c91ef031da7f1a2c4a447925a8c?d=identicon)[mpakfm](/maintainers/mpakfm)

---

Top Contributors

[![mpakfm](https://avatars.githubusercontent.com/u/25681398?v=4)](https://github.com/mpakfm "mpakfm (12 commits)")

### Embed Badge

![Health badge](/badges/mpakfm-printu/health.svg)

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.5k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M276](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M343](/packages/open-telemetry-sdk)

PHPackages © 2026

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