2017 © Pedro Peláez
 

library monolol

PSR-3 compliant lol-gger

image

phpointless/monolol

PSR-3 compliant lol-gger

  • Saturday, January 23, 2016
  • by devwebpeanuts
  • Repository
  • 6 Watchers
  • 94 Stars
  • 80 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 9 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Monolol

PSR-3 compliant lol-gger, (*1)

QA

SensioLabsInsight, (*2)

Build Status Scrutinizer Code Quality Scrutinizer Code Coverage, (*3)

INSTALLATION

Use composer:, (*4)

composer require PHPointless/monolol

HOW TO USE IT

Monolol provides a new wrapper handler for Monolog: LolHandler. LolHandler will apply a Lolifier that will do some stuff on records handled by the wrapped handler., (*5)

For example, we want to randomly shuffle the log message words of all records that will be handled by a Monolog StreamHandler. Here is code that will do the trick:, (*6)

<?php

use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Monolol\Handlers\LolHandler;
use Monolol\Lolifiers;

$logger = new Logger('myLog');
$streamHandler = new StreamHandler(__DIR__ . '/monolol.log');

$lolHandler = new LolHandler($streamHandler, new Lolifiers\Shuffle());

$logger->pushHandler($lolHandler);

$logger->info('My littlest pony');
$logger->error('This burger has no cheese');

AVAILABLE LOLIFIERS

  • Blackout: Forgot half the sentence
  • Shuffle: Words contained in the record message will be randomly shuffled
  • Confuse: This lolifier will change randomly the log level of the record
  • GeekTime: Records will be handled only if it's 1:37pm (13:37)
  • Hangman: Want to play hangman game while reading your logfiles?
  • Hash: Messages will be hashed with a randomly chosen algorithm
  • LaMerNoire: Messages will be replaced by the following string: 'La mer Noire'
  • Mirror: Messages' content will be reversed (desrever eb lliw tnetnoc egassem sdrocer)
  • NotGiveAFuck: Messages having loglevel above INFO will be replaced by the following string: "It seems that your application has encountered an issue. But as we don't give a fuck, we will not tell you what the problem is. Have a good day"
  • NyanCat: Nya nya nya nya nya nya nya nya nya nya nya!
  • Quote: Messages will be replaced by a quote randomly chosen. Quote Lolifier needs a QuoteProvider. Here's an example of how to use it:
$quoteProvider = new Lolifiers\QuoteProviders\Kaamelott\Kadoc();
$lolHandler = new LolHandler($streamHandler, new Lolifiers\Quote($quoteProvider));

If you want quotes from more than one provider, you can use QuoteProviders\Collection:, (*7)

$quoteProvider = new Lolifiers\QuoteProviders\Collection();
$quoteProvider->add(new Lolifiers\QuoteProviders\Kaamelott\Kadoc())
              ->add(new Lolifiers\QuoteProviders\Kaamelott\Karadoc())
              ->add(new Lolifiers\QuoteProviders\Kaamelott\Perceval());
$lolHandler = new LolHandler($streamHandler, new Lolifiers\Quote($quoteProvider));
  • Warp: Handled records will travel through the Warp
  • Yell: TO READ YOUR LOG FILES IN NOISY ENVIRONMENTS
  • Yolo: "An error? What are you talking about? There was no error!". All records having loglevel above INFO will not be handled
  • Tourette: Monolog is suffering from Tourette's syndrome. This lolifier needs a SwearWordsProvider. Here's an example of how to use it:
$swearWordsProvider = new Lolifiers\SwearWordsProviders\DefaultProvider();
$lolHandler = new LolHandler($streamHandler, new Lolifiers\Tourette($swearWordsProvider));

The Versions

23/01 2016

dev-master

9999999-dev

PSR-3 compliant lol-gger

  Sources   Download

MIT

The Requires

 

The Development Requires

by Claude LE BRIS
by Romain Renaud

psr3 lol lol-gging

23/01 2016

1.2.0

1.2.0.0

PSR-3 compliant lol-gger

  Sources   Download

MIT

The Requires

 

The Development Requires

by Claude LE BRIS
by Romain Renaud

psr3 lol lol-gging

13/01 2016

1.1.0

1.1.0.0

PSR-3 compliant lol-gger

  Sources   Download

MIT

The Requires

 

The Development Requires

by Claude LE BRIS
by Romain Renaud

psr3 lol lol-gging

04/03 2015

1.0.0

1.0.0.0

PSR-3 compliant lol-gger

  Sources   Download

MIT

The Requires

 

The Development Requires

by Romain Renaud

psr3 lol lol-gging