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

Expose logger through api operation base #187

Closed

Conversation

HeathNaylor
Copy link

@HeathNaylor HeathNaylor commented Nov 21, 2016

Problem:
There is currently no way to set the log level of the logger class

Solution:
Expose the logger via a getter on the API Operation Base class. Any class extending this (Controllers) will now have access to the logger and be able to invoke $controller->getLogger()->setLogLevel(Log::ANET_LOG_WARN);

Notable changes:

  • All globally defined variables have been moved into the class scope as public constants. This will prevent implementers of this library from defining the global variables and raising PHP notices. This also allows for any IDE to pick up on the public visibility and give the constants as recommended selections.
  • $logger should never be null

Fixes #186

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

Successfully merging this pull request may close these issues.

1 participant