2017 © Pedro Peláez
 

library slog

Singleton and Simple, PSR-3 Logger Container

image

uzulla/slog

Singleton and Simple, PSR-3 Logger Container

  • Wednesday, September 17, 2014
  • by uzulla
  • Repository
  • 1 Watchers
  • 0 Stars
  • 48 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

SLog.php

Singleton and Simple, PSR-3 Logger Container, (*1)

WHY?

I want use something like a Object::Container(perl)., (*2)

and, some convinience feature., (*3)

SYNOPSIS

setup

Sample using monolog., (*4)

<?php
$app_log = new \Monolog\Logger('APP');
$app_log->pushHandler(new \Monolog\Handler\StreamHandler(__DIR__.'app.log', \Monolog\Logger::DEBUG));
\Uzulla\SLog::setLogger('APP', $app_log);

use

<?php
use \Uzulla\SLog as L;

// any location

$logger = L::getLogger('APP'); 
$logger->debug('debug me!!');
//or
L::getLogger('APP')->info("log!", ['why'=>'kantanbenri']); 

KANTANBENRI

<?php
// any setup.
\Uzulla\SLog::debug('uhoh!!'); // ok!

that do like, (*5)

<?php

$app_log = new \Uzulla\SLog\SimpleLogger(); // about SimpleLogger, see under.
\Uzulla\SLog::setLogger('_', $app_log);

//...

L::getLogger('_')->info("uhoh!");

this is usable in haste.(but not smart), (*6)

Simple Logger

This library contain simple PSR-3 Logger \Uzulla\SLog\SimpleLogger., (*7)

<?php
use \Uzulla\SLog\SimpleLogger;

// out put to error_log(), log level DEBUG.
$log = new SimpleLogger();
// or
// out put to error_log(), log level NOTICE
$log = new SimpleLogger(SimpleLogger::NOTICE);
// or
// out put to 'test.log', log level WARNING
$log = new SimpleLogger(SimpleLogger::WARNING, __DIR__.'/test.log');

// ...

$log->alert('ALERT!!!');

That use error_log(). unless setting log filename., (*8)

LICENSE

MIT, (*9)

The Versions

17/09 2014

dev-master

9999999-dev https://github.com/uzulla/SLog.php

Singleton and Simple, PSR-3 Logger Container

  Sources   Download

MIT

The Requires

 

The Development Requires

log psr-3

17/09 2014

v0.2.2

0.2.2.0 https://github.com/uzulla/SLog.php

Singleton and Simple, PSR-3 Logger Container

  Sources   Download

MIT

The Requires

 

The Development Requires

log psr-3

26/05 2014

v0.2.1

0.2.1.0 https://github.com/uzulla/SLog.php

Singleton and Simple, PSR-3 Logger Container

  Sources   Download

MIT

The Requires

 

The Development Requires

log psr-3

26/05 2014

v0.2.0

0.2.0.0 https://github.com/uzulla/SLog.php

Singleton and Simple, PSR-3 Logger Container

  Sources   Download

MIT

The Requires

 

The Development Requires

log psr-3

24/05 2014

v0.1.0

0.1.0.0 https://github.com/uzulla/SLog.php

Singleton and Simple, PSR-3 Logger Container

  Sources   Download

MIT

The Requires

 

The Development Requires

log psr-3