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
- Host: GitHub
- URL: https://github.com/osd84/lightlogger
- Owner: osd84
- License: mit
- Created: 2022-05-13T09:53:11.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-06T20:10:56.000Z (9 months ago)
- Last Synced: 2025-09-26T09:30:26.401Z (4 months ago)
- Topics: brutalism, php, php-libraries
- Language: PHP
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LightLogger
A stupid and brutal PHP **logger system**
Orignally found in gist kevinchappell
## Requirements
- PHP 7.4+

## 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
```