scoobydam/console-logger

Simple and light PHP console logger

1.0.0 2021-04-07 14:27 UTC

This package is auto-updated.

Last update: 2024-04-07 21:19:31 UTC


README

This library permits you to easily log messages in console for PHP scripts and apps.

Codacy Badge

Prerequisites

  • PHP >= 7.3

Install

You can install the package with git clone and composer install in the directory.

Or you can directly use composer :

composer require scoobydam/console-logger

Use

This library is an easy-to-use and light one.

use ScoobyConsoleLogger\ConsoleLogger;

$consoleLogger = new ConsoleLogger();

$consoleLogger->alert('This is an alert !')
    ->divider()
    ->critical('This is critical :/')
    ->emergency('This is an emergency !')
    ->echo('echo some text')
    ->error('This is an error :(')
    ->info('There can be some informations')
    ->notice('Something you need to notice')
    ->success('This is a success !')
    ->warning('This is a warning')
    ->debug('Some debug informations you need to print')
    ->title('This is for some title')
;

$consoleLogger->divider();

You can chain the functions like in the example above or you can just call your logger in different line.

Full documentation

To know all what you can do, you can find full documentation here.

Contributions

You can send PRs if you want to :)

Just, please, follow these conventions.