[PR #35] [MERGED] onActionExecuted event for better logs handling #36

Closed
opened 2026-02-26 17:32:15 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Corsinvest/cv4pve-api-php/pull/35
Author: @lukasbruha
Created: 5/17/2024
Status: Merged
Merged: 5/17/2024
Merged by: @franklupo

Base: masterHead: master


📝 Commits (1)

  • 4921cdc onActionExecuted event for better logs handling

📊 Changes

1 file changed (+23 additions, -2 deletions)

View changed files

📝 src/PveClientBase.php (+23 -2)

📄 Description

An alternative to setDebugLevel() that prints log information on screen only. This new feature helps developers to subscribe event to log executed actions and their result into own log file, DB, whatever... Thanks to this, any debugging can be done on production environment as well.

Usage:

$pveClient->onActionExecuted[] = function($result, $curlCallParameters) {
    // log result or cURL call parameters to own log, send mail notification on HTTP codes > 400 etc.
};

Method executeAction() set to protected to allow modify this method by own.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Corsinvest/cv4pve-api-php/pull/35 **Author:** [@lukasbruha](https://github.com/lukasbruha) **Created:** 5/17/2024 **Status:** ✅ Merged **Merged:** 5/17/2024 **Merged by:** [@franklupo](https://github.com/franklupo) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`4921cdc`](https://github.com/Corsinvest/cv4pve-api-php/commit/4921cdc0fbf29e249f3f51177151bfbaa7944934) onActionExecuted event for better logs handling ### 📊 Changes **1 file changed** (+23 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/PveClientBase.php` (+23 -2) </details> ### 📄 Description An alternative to setDebugLevel() that prints log information on screen only. This new feature helps developers to subscribe event to log executed actions and their result into own log file, DB, whatever... Thanks to this, any debugging can be done on production environment as well. Usage: ``` $pveClient->onActionExecuted[] = function($result, $curlCallParameters) { // log result or cURL call parameters to own log, send mail notification on HTTP codes > 400 etc. }; ``` Method executeAction() set to protected to allow modify this method by own. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 17:32:15 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cv4pve-api-php#36
No description provided.