Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/00f100/fcphp-log

Package to manipulate log application
https://github.com/00f100/fcphp-log

fcphp fcphp-log log logger php7

Last synced: 5 days ago
JSON representation

Package to manipulate log application

Awesome Lists containing this project

README

        

# FcPhp Log

Package to manipulate logs of application FcPhp

[![Build Status](https://travis-ci.org/00F100/fcphp-log.svg?branch=master)](https://travis-ci.org/00F100/fcphp-log) [![codecov](https://codecov.io/gh/00F100/fcphp-log/branch/master/graph/badge.svg)](https://codecov.io/gh/00F100/fcphp-log) [![Total Downloads](https://poser.pugx.org/00F100/fcphp-log/downloads)](https://packagist.org/packages/00F100/fcphp-log)

## How to install

Composer:

```sh
$ composer require 00f100/fcphp-log
```

or add in composer.json

```json
{
"require": {
"00f100/fcphp-log": "*"
}
}
```

## How to use

Create logs easy! If `$debug = false` in constructor, just `$log->error()` and `$log->warning()` works...

```php
error('message of error');
// Print log: var/log/error.log
// [2018-06-16 04:06:25] message of error

// To warning logs
$log->warning('message of warning');
// Print log: var/log/warning.log
// [2018-06-16 04:06:25] message of warning

// To debug
$log->debug('message debug');
// Print log: var/log/debug.log
// [2018-06-16 04:06:25] message debug

// To many types
$log->fooBar('message foo bar');
// Print log: var/log/fooBar.log
// [2018-06-16 04:06:25] message foo bar

```

### Custom format log

```php
customLog(function(string $dateTime, string $logText, string $breakLine) {
return $logText . ' ' . $dateTime . $breakLine;
});

$log->error('Custom message, custom format');
// Print log: var/log/error.log
// Custom message, custom format [2018-06-16 04:06:25]

```