2017 © Pedro Peláez
 

library default-logger

A simple PSR-3 compliant logger

image

myena/default-logger

A simple PSR-3 compliant logger

  • Sunday, March 11, 2018
  • by dcarbone
  • Repository
  • 4 Watchers
  • 1 Stars
  • 140 Installations
  • PHP
  • 4 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 65 % Grown

The README.md

default-psr-logger

A simple PSR-3 compliant logger, (*1)

Build Status, (*2)

Installation

This library is designed to be used with Composer, (*3)

Require entry:, (*4)

{
    "myena/default-logger": "@stable"
}

Basic Usage

$logger = new \MyENA\DefaultLogger();

$logger->debug('hello!');

Defaults

The default level of this logger is debug, (*5)

The default stream for this logger is php://output, (*6)

Custom Levels

You may specify custom levels one of two ways:, (*7)

Construction:, (*8)

$logger = new \MyENA\DefaultLogger(\Psr\Log\LogLevel::INFO);

Post-Construction:, (*9)

$logger->setLogLevel(\Psr\Log\LogLevel::INFO);

If you attempt to specify a level not denoted by \Psr\Log\LogLevel, an exception will be thrown., (*10)

Custom Stream

If you wish for the log output to go to a file or some other resource writeable by the fwrite function, you may pass it in as the 2nd argument., (*11)

$logger = new \MyENA\DefaultLogger(\Psr\Log\LogLevel::DEBUG, fopen('tmp/test.log', 'ab'));

If this file becomes un-writeable for some reason, it will attempt to reconstruct the internal resource. If it is unable, it will revert to using the stream returned by the defaultStream()., (*12)

NOTE: No write-ability determination is done, if you pass in a read-only stream it will ultimately not work., (*13)

The Versions

11/03 2018

dev-master

9999999-dev

A simple PSR-3 compliant logger

  Sources   Download

MPL-2.0 MPLv2.0

The Requires

 

The Development Requires

by Daniel Carbone

11/03 2018

1.1.2

1.1.2.0

A simple PSR-3 compliant logger

  Sources   Download

MPL-2.0

The Requires

 

The Development Requires

by Daniel Carbone

09/02 2018

1.1.1

1.1.1.0

A simple PSR-3 compliant logger

  Sources   Download

MPL-2.0

The Requires

 

The Development Requires

by Daniel Carbone

09/02 2018

dev-feature/ansi-logger

dev-feature/ansi-logger

A simple PSR-3 compliant logger

  Sources   Download

MPL-2.0 MPLv2.0

The Requires

 

The Development Requires

by Daniel Carbone

02/08 2017

1.1.0

1.1.0.0

A simple PSR-3 compliant logger

  Sources   Download

MPLv2.0

The Requires

 

The Development Requires

by Daniel Carbone

09/02 2017

1.0.0

1.0.0.0

A simple PSR-3 compliant logger

  Sources   Download

MPLv2.0

The Requires

 

The Development Requires

by Daniel Carbone