Skip to content

Commit

Permalink
improved docs for #14273
Browse files Browse the repository at this point in the history
  • Loading branch information
cebe committed Sep 6, 2017
1 parent 8700fd7 commit 9d854c0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions framework/log/Target.php
Expand Up @@ -313,6 +313,16 @@ public function getMessagePrefix($message)
* Sets a value indicating whether this log target is enabled.
* @param bool|callable $value a boolean value or a callable to obtain the value from.
* The callable value is available since version 2.0.13.
*
* A callable may be used to determine whether the log target should be enabled in a dynamic way.
* For example, to only enable a log if the current user is logged in you can configure the target
* as follows:
*
* ```php
* 'enabled' => function() {
* return !Yii::$app->user->isGuest;
* }
* ```
*/
public function setEnabled($value)
{
Expand Down

0 comments on commit 9d854c0

Please sign in to comment.