Skip to content

Commit

Permalink
Merging in feature/full-logging
Browse files Browse the repository at this point in the history
  • Loading branch information
srtfisher committed Apr 26, 2024
2 parents 56b999b + 4cdd608 commit 600128f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions inc/handler/class-post-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,16 @@ protected function insert_permitted( string $transient_key, array $log ): bool {
return true;
}

/**
* Allow unrestricted logging if filtered.
*
* @param bool $unrestricted_logging Whether to allow unrestricted logging.
* @param array $log Log arguments.
*/
if ( \apply_filters( 'ai_logger_unrestricted_logging', false, $log ) ) {
return true;
}

/**
* The throttling transient has expired if get_transient returns false,
* and a new insert should be permitted.
Expand All @@ -277,9 +287,8 @@ protected function insert_permitted( string $transient_key, array $log ): bool {
}

/**
* Assign the terms associated with the new post, currently
* used to apply a Log Level (info, warning, error) and the
* custom context to a log
* Assign the terms associated with the new post, currently used to apply a
* Log Level (info, warning, error) and the custom context to a log
*
* @param int $new_post_id Post ID.
* @param string $term Term name.
Expand Down

0 comments on commit 600128f

Please sign in to comment.