Permalink
Browse files

integrate logger with facade

  • Loading branch information...
1 parent c5a55cd commit 5476d20a9b5035c318066863dcd57a6a98f595c9 = committed Apr 11, 2012
Showing with 5 additions and 2 deletions.
  1. +1 −0 RedBean/Facade.php
  2. +2 −2 RedBean/Logger.php
  3. +2 −0 RedBean/redbean.inc.php
View
1 RedBean/Facade.php
@@ -149,6 +149,7 @@ public static function selectDatabase($key) {
* @param RedBean_ILogger $logger
*/
public static function debug( $tf = true, $logger = NULL ) {
+ if (!$logger) $logger = new RedBean_Logger;
self::$adapter->getDatabase()->setDebugMode( $tf, $logger );
}
View
4 RedBean/Logger.php
@@ -22,9 +22,9 @@ class RedBean_Logger implements RedBean_ILogger {
public function log() {
if (func_num_args() > 0) {
foreach (func_get_args() as $argument) {
- echo print_r($argument,1);
+ if (is_array($argument)) echo print_r($argument,true); else echo $argument;
+ echo "<br>\n";
}
- echo "\n";
}
}
}
View
2 RedBean/redbean.inc.php
@@ -40,6 +40,8 @@
$dir = dirname(__FILE__) . '/';
//Load Database drivers
+require($dir.'ILogger.php');
+require($dir.'Logger.php');
require($dir.'Driver.php');
require($dir.'Driver/PDO.php');

0 comments on commit 5476d20

Please sign in to comment.