Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PSR-3 #112

Closed
neomerx opened this issue Mar 14, 2016 · 1 comment
Closed

Add support for PSR-3 #112

neomerx opened this issue Mar 14, 2016 · 1 comment
Assignees
Milestone

Comments

@neomerx
Copy link
Owner

neomerx commented Mar 14, 2016

Add optional logging (debug feature) for PSR-3

@neomerx
Copy link
Owner Author

neomerx commented Mar 14, 2016

In all major lib parts logs could be written as following

// no need to check for null
$this->log->debug(...);

As the lib is extremely tested I don't feel any specific logs are needed at the moment. For debugging purposes logs could be turn on by replacing Encoder::instance(...) with $this->createLoggedEncoder(...) which will save logs in root folder. Logs are based on monolog so they are highly configurable.

External users might use own logs as following

$log     = ...;
$factory = new Factory();
$factory->setLogger($log);

$container = $factory->createContainer($schemas);
$encoder   = $factory->createEncoder($container, $encodeOptions);

$encoder->encodeData(...);

Logs tested and working. Don't see anything to add at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant