1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-07-31 02:10:22 +02:00

Pull in mlehner/gelf-php via Composer

This commit is contained in:
Marc Abramowitz
2012-04-06 07:25:02 -07:00
parent c9e61750d0
commit 14ac76a0ae
5 changed files with 35 additions and 4 deletions

2
.gitignore vendored
View File

@@ -1 +1,3 @@
vendor
composer.phar
phpunit.xml

View File

@@ -19,10 +19,18 @@
{
"type": "vcs",
"url": "https://github.com/mlehner/gelf-php"
},
{
"type": "vcs",
"url": "https://github.com/msabramo/gelf-php-1"
},
{
"type": "vcs",
"url": "https://github.com/msabramo/gelf-php"
}
],
"suggest": {
"gelf-php": ">=0"
"mlehner/gelf-php": "dev-add-composer-support"
},
"autoload": {
"psr-0": {"Monolog": "src/"}

11
composer.lock generated Normal file
View File

@@ -0,0 +1,11 @@
{
"hash": "5715c4c52bc66b23002954fb3a2f47e4",
"packages": [
{
"package": "mlehner/gelf-php",
"version": "dev-add-composer-support",
"source-reference": "39419c2b75daf6b9eb9feb6ac0541807ee888cda"
}
],
"aliases": []
}

View File

@@ -11,14 +11,15 @@
namespace Monolog\Handler;
use Monolog\TestCase;
use Monolog\Logger;
use Gelf\MessagePublisher;
class GelfHandlerTest extends \PHPUnit_Framework_TestCase
class GelfHandlerTest extends TestCase
{
public function setUp()
{
if (!class_exists("MessagePublisher"))
if (!class_exists("Gelf\MessagePublisher"))
{
$this->markTestSkipped("https://github.com/mlehner/gelf-php not installed");
}
@@ -35,6 +36,14 @@ class GelfHandlerTest extends \PHPUnit_Framework_TestCase
protected function getMessagePublisher()
{
return new MessagePublisher();
return new MessagePublisher('localhost');
}
public function testStuff()
{
$handler = new GelfHandler($this->getMessagePublisher());
$handler->setFormatter($this->getIdentityFormatter());
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::WARNING));
}
}

View File

@@ -9,6 +9,7 @@
* file that was distributed with this source code.
*/
require_once __DIR__ . "/../vendor/.composer/autoload.php";
require_once __DIR__.'/Monolog/TestCase.php';
spl_autoload_register(function($class)