itflow-org / itflow

Free and open-source web application for MSPs. Unifies IT documentation, ticketing, invoicing.
https://itflow.org
GNU General Public License v3.0
570 stars 147 forks source link

Feature Request: Convert logging to a function #1039

Open wrongecho opened 1 month ago

wrongecho commented 1 month ago

If we convert logging to a function, we can save on a lot of repetition, e.g.


Something like logAction( type , action , description , client_id (nullable) , entity_id (nullable) )

Would convert the below: mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Interface', log_action = 'Delete', log_description = '$session_name deleted interface $interface_name from asset $asset_name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $asset_id");

into: logAction('Interface', 'Delete', '$session_name deleted interface $interface_name from asset $asset_name', $client_id, $asset_id);

johnnyq commented 1 month ago

Hey @wrongecho this would be fantastic totally up for this