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
580 stars 148 forks source link

Feature Request: Convert logging to a function #1039

Closed wrongecho closed 1 week ago

wrongecho commented 2 months 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 2 months ago

Hey @wrongecho this would be fantastic totally up for this

johnnyq commented 1 week ago

logging has been functionalized, working slowly to implement everywhere https://github.com/itflow-org/itflow/commit/7b4dda0ad612de9cbcc89fe6625195df9f243c38

closing out