codeguy/Slim — pull request #501 by gmanricks (2013-04-08 21:41:23+00:00)
Title: Make Slim PSR compliant

## PSR Compliance

These updates change the Slim/Log class to make it PSR-3 compliant as-well as general tweaks on some other files to make them PSR-2 compliant.

I left support for some old methods in Slim/Log to keep it backwards compatible, but I have marked them with DEPRECATED so they can be removed in the future.

## Slim / Log methods
The new class provides access to the following methods:
```php
$log->debug( mixed $object, array $context = array() );
$log->info( mixed $object, array $context = array() );
$log->notice( mixed $object, array $context = array() );
$log->warning( mixed $object, array $context = array() );
$log->error( mixed $object, array $context = array() );
$log->critical( mixed $object, array $context = array() );
$log->alert( mixed $object, array $context = array() );
$log->emergency( mixed $object, array $context = array() );
$log->log( mixed $level, mixed $object, array $context = array() );
```
As per the PSR-3 standard, the following functions are marked as DEPRECATED but still work, as they are being mapped to the new methods:
```php
$log->warn( mixed $object, array $context = array() );
$log->fatal( mixed $object, array $context = array() );
$log->write( mixed $object, int $level);
```

## Placeholders in error messages
As per the PSR-3 standard, messages can contain placeholders in the format {placeholder_name}. No spaces may be used between the placeholder's name and brackets. The optional context array needs to contain the value for each placeholder in-order for it to be replaced.

Here is an example:
```php
$log->debug(
"{greeting} {place}",
array(
"greeting" => "Hello"
)
);
```

Will send the message "Hello {place}" to the log writer.