mehmetnky/logger

A light-weight logger library

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/mehmetnky/logger

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

This package is not auto-updated.

Last update: 2026-01-14 11:54:46 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.