summaryrefslogtreecommitdiff
path: root/lib/Kolab/FreeBusy/Logger.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Kolab/FreeBusy/Logger.php')
-rw-r--r--lib/Kolab/FreeBusy/Logger.php18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/Kolab/FreeBusy/Logger.php b/lib/Kolab/FreeBusy/Logger.php
index 97596c3..abb0060 100644
--- a/lib/Kolab/FreeBusy/Logger.php
+++ b/lib/Kolab/FreeBusy/Logger.php
@@ -1,15 +1,11 @@
<?php
-namespace Kolab;
-
-use Monolog\Logger;
-use Monolog\Handler\NullHandler;
-use Monolog\Handler\StreamHandler;
+namespace Kolab\FreeBusy;
/**
* Helper class for creating up Monolog instanced with local configration
*/
-class FBLogger
+class Logger
{
private static $instances = array();
@@ -19,20 +15,20 @@ class FBLogger
public static function get($name, $level = 0)
{
if (!isset(self::$instances[$name])) {
- $logger = new Logger($name);
+ $logger = new \Monolog\Logger($name);
// TODO: support more log drivers
- $config = FBConfig::getInstance();
+ $config = Config::getInstance();
switch ($config->get('log.driver')) {
case 'file':
$logdir = self::realpath($config->get('log.path'));
- $loglevel = $level ?: $config->get("log.level", Logger::INFO);
- $logger->pushHandler(new StreamHandler($logdir . $name. '.log', $loglevel));
+ $loglevel = $level ?: $config->get("log.level", \Monolog\Logger::INFO);
+ $logger->pushHandler(new \Monolog\Handler\StreamHandler($logdir . $name. '.log', $loglevel));
break;
default:
// null handler if logging is disabled
- $logger->pushHandler(new NullHandler);
+ $logger->pushHandler(new \Monolog\Handler\NullHandler);
}
self::$instances[$name] = $logger;