Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/00f100/fcphp-log
- Owner: 00F100
- License: mit
- Created: 2018-06-15T00:09:24.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-05T05:01:56.000Z (almost 6 years ago)
- Last Synced: 2024-12-08T19:25:56.565Z (29 days ago)
- Topics: fcphp, fcphp-log, log, logger, php7
- Language: PHP
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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]```