xp-framework/core — pull request #4 by thekid (2013-12-28 23:06:36+00:00)
Title: Generic LogCategory::log($level, $args)

This pull request adds a generic `log()` method to `util.log.LogCategory` which accepts the log level and an array of arguments. This method is the same as the previos protected `callAppenders()` method, only now public and with a more generic name, so no additional overhead is added.

With this in place, we can easily log events given a level and arguments instead of having to resort to `call_user_func`. An example where this would be useful can be seen in xp-forge/mustache#1:

```html
{{log info "Look at me!"}}
```

```php
$engine= create(new MustacheEngine())->withHelpers(array(
'log' => function($in, $context, $options) use($cat) {
$cat->log(LogLevel::named($options[0]), array_slice($options, 1));
return ''; // Remove
}
);
```