From f6f9ddc7e71e57998747861b0129355e88b1fdc0 Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Tue, 2 Mar 2021 15:50:39 +0100 Subject: [PATCH] adjust documentation --- CHANGELOG.md | 31 ++++++++++++++++++++++++++++++- README.md | 27 +++++++++++++++++++++++++++ src/LoggerFactory.php | 4 +++- 3 files changed, 60 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bacbd59..38cf3d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,36 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.3.0] - 2021-03-02 + +### Fixed + +- fix missing static methods + +### Added + +- add configurable FirePHP handler + +--- + +## [1.2.2] - 2021-01-23 + +### Changed + +- change static methods to non-static methods for better testable code +- change line endings for easy patching + +### Added + +- add prepared statement generator + +--- + +## [1.2.1] - 2020-05-01 + +### Fixed + +- add missing autoload file item in composer.json --- diff --git a/README.md b/README.md index 65c88de..c751948 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,33 @@ CLI: ![Example CLI](https://raw.githubusercontent.com/d3datadevelopment/oxid-sql-logger/master/img/screenshot-cli.jpg) +## Configuration + +Add the sections to the config.inc.php of the shop if needed: + +```php +$this->SqlLoggerGUIHandlers = [ + \Monolog\Handler\BrowserConsoleHandler::class, + \D3\OxidSqlLogger\Handler\d3FirePHPHandler::class +]; +``` + +Standard handlers are BrowserConsoleHandler and d3FirePHPHandler. + +```php +$this->SqlLoggerCLIHandlers = [ + ... +]; +``` + +Standard handler is StreamHandler. + +```php +$this->d3FirePHPOptions = [ + \D3\OxidSqlLogger\Handler\d3FirePHPHandler::ADD_TRACE +]; +``` + ## Credits Many thanks to [Tobias Matthaiou](https://github.com/TumTum/oxid-sql-logger) for his inspiration. diff --git a/src/LoggerFactory.php b/src/LoggerFactory.php index 4d2a5e2..e9b763f 100644 --- a/src/LoggerFactory.php +++ b/src/LoggerFactory.php @@ -35,7 +35,9 @@ class LoggerFactory $handlers = (isset($configuredHandlers) && $this->is_iterable($configuredHandlers)) ? $this->getInstancesFromHandlerList($configuredHandlers) : - [$this->getStreamHandler()]; + [ + $this->getStreamHandler() + ]; } else { $configuredHandlers = Registry::getConfig()->getConfigParam('SqlLoggerGUIHandlers');