2017 © Pedro Peláez
 

library composer_psr3

PSR-3 complaint logger for use with Composer IOInterface

image

noflash/composer_psr3

PSR-3 complaint logger for use with Composer IOInterface

  • Tuesday, October 25, 2016
  • by kiler129
  • Repository
  • 1 Watchers
  • 0 Stars
  • 305 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PROJECT ARCHIVED

While the code will (most likely) still work with Composer v1, this project is not maintained since 2016., (*1)


Composer PSR-3 Logger Build Status

Small, fast and PSR-3 compliant logging library useful with custom Composer scripts., (*2)

Requirements

  • PHP >=5.6

Installation

Add package to require-dev and use ;-), (*3)

Usage

Initialize Logger object in your Composer hook and optionally set custom verbosity levels - evetyhing else is automatic., (*4)

Available methods: * emergency/alert/...(message, context) - Every log level have method named after it. So if you want to log "warning" just use Logger->warning("Be warned!"). Second argument can be array with any information possible to represent as string by (formatted by print_r()). * log(level, message, context) - It have the same effect as methods described below, so calling Logger->log("warning", "Be warned!") produces the same result as example above., (*5)

Configuration

Logger comes preconfigured by default, but allows to configure almost anything. List below specifies configuration methods along with default values (specified in brackets). * setLineFormat(<%1$s> [%2$s] %3$s [%4$s] [%5$s]) - How line should be formated. You can use 6 modifiers: * %1$s - date * %2$s - log level (uppercased) * %3$s - message text * %4$s - context (formatted by print_r()) * %1$d - unix timestamp * setDatetimeFormat(d.m.Y H:i:s) - It accepts any date() compliant format. * setLevelVerbosity(level, value) - In fact PSR-3 states custom log levels are forbidden, but this logger supports them. By default messages with custom level uses verbosity defined by IOInterface::NORMAL. This method allows setting custom one (and even change builtin levels verbosity, which is NOT recommended)., (*6)

The Versions

25/10 2016

dev-master

9999999-dev

PSR-3 complaint logger for use with Composer IOInterface

  Sources   Download

MIT

The Requires

 

The Development Requires

by Grzegorz Zdanowski