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

Remove discussion on LoggerAwareTrait #4067

Merged
merged 1 commit into from
Jan 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions user_guide_src/source/general/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,3 @@ like Composer. Next, you should modify ``/app/Config/Services.php`` to point the
alias to your new class name.

Now, any call that is done through the ``log_message()`` function will use your library instead.

LoggerAware Trait
=================

If you would like to implement your libraries in a framework-agnostic method, you can use
the ``CodeIgniter\Log\LoggerAwareTrait`` which implements the ``setLogger()`` method for you.
Then, when you use your library under different environments for frameworks, your library should
still be able to log as it would expect, as long as it can find a PSR3 compatible logger.