mehmetnky/logger

A light-weight logger library

dev-main 2023-02-27 23:53 UTC

This package is not auto-updated.

Last update: 2024-05-08 04:04:29 UTC


README

Software License

A lightweight PSR-3 logger

Installation

$ composer require mehmetnky/logger

Usage

use Mehmetnky\Logger\Logger;

// Creates an "app.log" file in root folder.
$logger = new Logger();
// Or you can specify a path for your log file.
$logger = new Logger('custom/path/to/my.log');

$logger->emergency('Log message', ['additional', 'information']);
$logger->alert('Log message', ['additional', 'information']);
$logger->critical('Log message', ['additional', 'information']);
$logger->error('Log message', ['additional', 'information']);
$logger->warning('Log message', ['additional', 'information']);
$logger->notice('Log message', ['additional', 'information']);
$logger->info('Log message', ['additional', 'information']);
$logger->debug('Log message', ['additional', 'information']);

/* A Sample Log
[2023-02-27 11:06:34] DEBUG: Log message
MoreInfo:
0: additional
1: information
*/

License

The MIT License (MIT). Please see License File for more information.