-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance log messages #23
Conversation
Needs testing before I mark it as ready but feel free to comment on the approach @joshmcrae |
…ing other values injected inside it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$i
should be incremented after it is used to index $values
(unless indexes start at 1). Otherwise the first replacement will use the second parameter and so on.
The value replaced into the SQL should also be quoted so that it remains valid SQL.
@joshmcrae ah yup silly me. Changed $i to start at -1 |
@joshmcrae gave this more attention as it didn't quite operate as I thought. |
This PR allows the devs to inject the values into the SQL query logs as debugging queries without the values can be painful.
It is disabled by default to prevent anyone from accidentally exposing any information.
Additionally, I noticed my new Unit test was not actually being run so I deleted the PHPUnit config and just simply told it to run on the tests folder.
it appears there were a lot of tests being ignored by the original config.
With config, we get 785 assertions:
![CleanShot 2023-05-18 at 18 05 15@2x](https://private-user-images.githubusercontent.com/30540495/239179398-a1418417-ab61-49fd-9b9d-e88268467c8d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2NTIxODEsIm5iZiI6MTcxOTY1MTg4MSwicGF0aCI6Ii8zMDU0MDQ5NS8yMzkxNzkzOTgtYTE0MTg0MTctYWI2MS00OWZkLTliOWQtZTg4MjY4NDY3YzhkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI5VDA5MDQ0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVkMDJjMGE2NDA3MTI1NTg4NmJiNzM3Y2QzNzcwNGQ3OGY3ZDQ5NjAzNWVlM2Q0Nzg4N2IxMzY1NDY1NWE4Y2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.0qORQ8_Sd2gGk3cq9TvLNzFxdNTkLYWe_IXhY0CN6hk)
Without config 821 assertions:
![CleanShot 2023-05-18 at 18 05 58@2x](https://private-user-images.githubusercontent.com/30540495/239179809-9ed17784-192a-4264-976d-336015479d2e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2NTIxODEsIm5iZiI6MTcxOTY1MTg4MSwicGF0aCI6Ii8zMDU0MDQ5NS8yMzkxNzk4MDktOWVkMTc3ODQtMTkyYS00MjY0LTk3NmQtMzM2MDE1NDc5ZDJlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI5VDA5MDQ0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE2MzI4YTgyMWM4MTYzN2ZhY2M4OWZmNDg3MGUxMWQ4ZWRlNjJiYWU2ZTFiZGE0NWEzZTlkMjI3NmIxNTNhMmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.FhTKfbkuQL-kgGCvxKOw7fowLUNcbZyct985ACqUTGI)
and I only added 6 assertions myself.