diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b808e9..c00f429 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.1.0] - 2019-09-20 + +### Added + +- add log message +- add position specifications of the calling source code + ## [1.0.0] - 2019-07-21 +available in tumtum/oxid-sql-logger package only + ### Added - Global function `StartSQLLog` and `StopSQLLog` diff --git a/README.md b/README.md index 7201f53..8370e35 100644 --- a/README.md +++ b/README.md @@ -5,19 +5,19 @@ Returns all SQL queries into console of a Browser. ## Install -`composer require --dev tumtum/oxid-sql-logger` +`composer require --dev d3/oxid-sql-logger` ## Usage -Just set the function `StartSQLLog()` somewhere and from that point on all SQLs will be logged. +Just set the function `D3StartSQLLog()` somewhere and from that point on all SQLs will be logged. ```php -\StartSQLLog(); +\D3StartSQLLog('specific log message'); $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $list = $db->getAll('SELECT * FROM oxarticles WHERE oxprice < ? LIMIT 100', [49.99]); -\StopSQLLog(); +\D3StopSQLLog(); ``` ## Screenshots @@ -25,9 +25,8 @@ $list = $db->getAll('SELECT * FROM oxarticles WHERE oxprice < ? LIMIT 100', [49. Browser: ![Example all sqls](https://raw.githubusercontent.com/TumTum/oxid-sql-logger/master/img/screenshot-a.jpg) -![Example only one range](https://raw.githubusercontent.com/TumTum/oxid-sql-logger/master/img/screenshot-b.png) CLI: -![Example CLI](https://raw.githubusercontent.com/TumTum/oxid-sql-logger/master/img/screenshot-cli.png) +![Example CLI](https://raw.githubusercontent.com/TumTum/oxid-sql-logger/master/img/screenshot-cli.jpg) diff --git a/example/simple.php b/example/simple.php index 113492d..185d53c 100644 --- a/example/simple.php +++ b/example/simple.php @@ -2,9 +2,18 @@ require __DIR__ . '/../../../../source/bootstrap.php'; -\StartSQLLog(); +\D3StartSQLLog('Query for 100 items cheaper than 49,99'); $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $list = $db->getAll('SELECT * FROM oxarticles WHERE oxprice < ? LIMIT 100', [49.99]); -\StopSQLLog(); +\D3StopSQLLog(); + +// or + +\D3StartSQLLog(); + +$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); +$list = $db->getAll('SELECT * FROM oxarticles WHERE oxprice < ? LIMIT 100', [49.99]); + +\D3StopSQLLog(); diff --git a/img/screenshot-a.jpg b/img/screenshot-a.jpg index e166685..7d5390c 100644 Binary files a/img/screenshot-a.jpg and b/img/screenshot-a.jpg differ diff --git a/img/screenshot-b.png b/img/screenshot-b.png deleted file mode 100644 index 4a52b5a..0000000 Binary files a/img/screenshot-b.png and /dev/null differ diff --git a/img/screenshot-cli.jpg b/img/screenshot-cli.jpg new file mode 100644 index 0000000..a59597a Binary files /dev/null and b/img/screenshot-cli.jpg differ diff --git a/img/screenshot-cli.png b/img/screenshot-cli.png deleted file mode 100644 index ac7db34..0000000 Binary files a/img/screenshot-cli.png and /dev/null differ