An open API service indexing awesome lists of open source software.

https://github.com/osd84/lightlogger

A stupid and brutal PHP logger system
https://github.com/osd84/lightlogger

brutalism php php-libraries

Last synced: about 2 months ago
JSON representation

A stupid and brutal PHP logger system

Awesome Lists containing this project

README

          

# LightLogger

A stupid and brutal PHP **logger system**
Orignally found in gist kevinchappell



## Requirements

- PHP 7.4+

![screen.png](screen.png)

## Installation

```
composer require osd84/lightlogger
```

## Usage

```php
info('an Info'); // May-13-2022 10:34:57 | Info: an Info
$log->error('an Err'); // May-13-2022 10:34:57 | Error: an Err
$log->beer('an Beer'); // May-13-2022 10:34:57 | Beer: an Beer

// if want silent Log
$log = new NoLogger();
$log->info('an Info'); // null
$log->error('an Err'); // null
$log->beer('an Beer'); // null

// Why, because some time you need silent log simply ?
$debug = false;
if($debug) {
$log = new Logger(ROOT . '/logs/')
} else {
$log = new NoLogger();
}
$log->info('Log is Disabled') // null

$debug = true;
if($debug) {
$log = new Logger(ROOT . '/logs/')
} else {
$log = new NoLogger();
}
$log->info('Log is Enabled') // May-13-2022 10:34:57 | Info: Log is Enabled
```

## Tests

Simple Tests by running

```sh
php tests/run.php
```