Skip to content

Instantly share code, notes, and snippets.

@PyYoshi
Created May 19, 2014 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PyYoshi/484f530827ad844e135f to your computer and use it in GitHub Desktop.
Save PyYoshi/484f530827ad844e135f to your computer and use it in GitHub Desktop.
<?php
use Fluent\Logger\Entity;
use Fluent\Logger\PackerInterface;
class MsgpackPacker implements PackerInterface
{
/**
* pack entity as a msgpack format.
*
* @param Entity $entity
* @return string
*/
public function pack(Entity $entity)
{
return msgpack_pack(array($entity->getTag(), $entity->getTime(), $entity->getData()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment