2017 © Pedro Peláez
 

library logger

A very simple logger

image

phputil/logger

A very simple logger

  • Tuesday, February 13, 2018
  • by thiagodp
  • Repository
  • 1 Watchers
  • 0 Stars
  • 94 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

Logger

A very simple logger for PHP. No magic configuration required. Just the basic features you need most., (*1)

Provided interfaces and classes:, (*2)

Available log methods:, (*3)

  • bool debug( string $message, Exception $e = null, array $context = array() );
  • bool info( string $message, Exception $e = null, array $context = array() );
  • bool warn( string $message, Exception $e = null, array $context = array() );
  • bool error( string $message, Exception $e = null, array $context = array() );
  • bool log( string $logType, string $message, Exception $e = null, array $context = array() );

Installation

composer require phputil/logger

Example 1

info( 'Something will happen' );
$logger->debug( 'Something happened.' );
$logger->warn( 'Wait!' );
$logger->error( 'Ouch.' );

$logger->log( Logger::DEBUG, "That's awesome!" );
?>

Example 2

info( 'Something will happen' );
try {
    throw new \Exception( 'Hummm... something bad happened.' );
} catch ( \Exception $e ) {
    // Logs message and trace
    $logger->error( 'Ouch, I did not expect that!', $e );
}

$logger->log( Logger::DEBUG, "That's awesome!" );
?>

Example 3

info( 'It can log to the console too!' );
?>

The Versions

13/02 2018

dev-master

9999999-dev http://github.com/thiagodp/logger

A very simple logger

  Sources   Download

LGPL-3 LGPL-3.0-or-later

The Requires

  • php >=5.2.0

 

log file php

06/05 2017

1.3

1.3.0.0 http://github.com/thiagodp/logger

A very simple logger

  Sources   Download

LGPL-3

The Requires

  • php >=5.2.0

 

log file php

15/04 2017

1.2

1.2.0.0 http://github.com/thiagodp/logger

A very simple logger

  Sources   Download

LGPL-3

The Requires

  • php >=5.2.0

 

log file php

19/01 2017

1.1

1.1.0.0 http://github.com/thiagodp/logger

A very simple logger

  Sources   Download

LGPL-3

The Requires

  • php >=5.2.0

 

log file php

10/07 2016

1.0

1.0.0.0 http://github.com/thiagodp/logger

A very simple logger

  Sources   Download

LGPL-3

The Requires

  • php >=5.2.0

 

log file php