2017 © Pedro Peláez
 

package fcphp-log

Logs for application fcphp

image

00f100/fcphp-log

Logs for application fcphp

  • Saturday, June 16, 2018
  • by 00F100
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

FcPhp Log

Package to manipulate logs of application FcPhp, (*1)

Build Status codecov Total Downloads, (*2)

How to install

Composer:, (*3)

$ composer require 00f100/fcphp-log

or add in composer.json, (*4)

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

How to use

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

<?php

use \FcPhp\Log\Log;

/*

    Method to return instance of Log

    @param string $directoryOutput Directory to write logs
    @param string|bool $dateFormat Format of date to print log. If `false` not print date
    @param string $extension Extension of file log
    @param bool $debug Enable debug mode
    @return FcPhp\Log\Interfaces\ILog

    Log::getInstance(string $directoryOutput, $dateFormat = 'Y-m-d H:i:s', string $extension = 'log', bool $debug = false) :ILog

*/

$log = Log::getInstance('var/log', 'Y-m-d H:i:s', 'log', true);

// To error logs
$log->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

use \FcPhp\Log\Log;

$log = Log::getInstance('var/log', 'Y-m-d H:i:s', 'log', true);

$log->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]

The Versions

16/06 2018

dev-master

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

Logs for application fcphp

  Sources   Download

The Requires

  • php >=7.2

 

The Development Requires

php application logs fcphp

16/06 2018

0.2.0

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

Logs for application fcphp

  Sources   Download

The Requires

  • php >=7.2

 

The Development Requires

php application logs fcphp

16/06 2018

0.1.2

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

Logs for application fcphp

  Sources   Download

The Requires

  • php >=7.2

 

The Development Requires

php application logs fcphp

16/06 2018

0.1.1

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

Logs for application fcphp

  Sources   Download

The Requires

  • php >=7.2

 

The Development Requires

php application logs fcphp

16/06 2018

0.1.0

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

Logs for application fcphp

  Sources   Download

The Requires

  • php >=7.2

 

The Development Requires

php application logs fcphp