Permalink
Browse files

Better naming

  • Loading branch information...
1 parent bad76ce commit 9cf31da70da9abb6a198c3628c6a9897acffa945 Simon Mönch committed Feb 26, 2013
View
@@ -184,7 +184,7 @@ Processors
- _MemoryUsageProcessor_: Adds the current memory usage to a log record.
- _MemoryPeakUsageProcessor_: Adds the peak memory usage to a log record.
- _ProcessIdProcessor_: Adds the process id to a log record.
-- _RequestTokenProcessor_: Adds a request token to a log record.
+- _UidProcessor_: Adds a unique identifier to a log record.
About
=====
@@ -12,24 +12,24 @@
namespace Monolog\Processor;
/**
- * Adds a request token into records
+ * Adds a unique identifier into records
*
* @author Simon Mönch <sm@webfactory.de>
*/
-class RequestTokenProcessor
+class UidProcessor
{
- private static $requestToken;
+ private static $uid;
public function __construct()
{
- if (null === self::$requestToken) {
- self::$requestToken = substr(hash('md5', uniqid('', true)), 0, 7);
+ if (null === self::$uid) {
+ self::$uid = substr(hash('md5', uniqid('', true)), 0, 7);
}
}
public function __invoke(array $record)
{
- $record['extra']['request_token'] = self::$requestToken;
+ $record['extra']['uid'] = self::$uid;
return $record;
}
@@ -13,15 +13,15 @@
use Monolog\TestCase;
-class RequestTokenProcessorTest extends TestCase
+class UidProcessorTest extends TestCase
{
/**
- * @covers Monolog\Processor\RequestTokenProcessor::__invoke
+ * @covers Monolog\Processor\UidProcessor::__invoke
*/
public function testProcessor()
{
- $processor = new RequestTokenProcessor();
+ $processor = new UidProcessor();
$record = $processor($this->getRecord());
- $this->assertArrayHasKey('request_token', $record['extra']);
+ $this->assertArrayHasKey('uid', $record['extra']);
}
}

0 comments on commit 9cf31da

Please sign in to comment.