Permalink
Browse files

Adding EchoLogger.

  • Loading branch information...
1 parent ba5fd87 commit 42c0e3b50abd99597bf57c4b817d51d3f403a2bb @jhuet jhuet committed Dec 1, 2012
Showing with 39 additions and 0 deletions.
  1. +38 −0 src/DoctrineMongoODMModule/Logging/EchoLogger.php
  2. +1 −0 src/DoctrineMongoODMModule/Module.php
@@ -0,0 +1,38 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+namespace DoctrineMongoODMModule\Logging;
+
+/**
+ * A logger that logs to the standard output using echo/var_dump.
+ *
+ * @license MIT
+ * @link www.doctrine-project.org
+ */
+class EchoLogger implements Logger
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function log(array $logs)
+ {
+ if ($logs) {
+ var_dump($logs);
+ }
+ }
+}
@@ -105,6 +105,7 @@ public function getServiceConfig()
'invokables' => array(
'DoctrineMongoODMModule\Logging\DebugStack' => 'DoctrineMongoODMModule\Logging\DebugStack',
'DoctrineMongoODMModule\Logging\LoggerChain' => 'DoctrineMongoODMModule\Logging\LoggerChain',
+ 'DoctrineMongoODMModule\Logging\EchoLogger' => 'DoctrineMongoODMModule\Logging\EchoLogger',
),
'aliases' => array(
'Doctrine\ODM\Mongo\DocumentManager' => 'doctrine.documentmanager.odm_default',

0 comments on commit 42c0e3b

Please sign in to comment.