summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-01-16 16:54:17 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-01-16 16:54:17 (GMT)
commit0054e800228ce53eae18fc531d122976cdac6510 (patch)
treeb4dd8e348aaca4dfc4afcb8870ee06e4310d3305
parent9fbb32d9b7f5c289878b8876400debfb4f9ac350 (diff)
downloadkolab-freebusy-0054e800228ce53eae18fc531d122976cdac6510.tar.gz
Nicer PHP namespace handling
-rw-r--r--lib/Kolab/FreeBusy/Logger.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Kolab/FreeBusy/Logger.php b/lib/Kolab/FreeBusy/Logger.php
index abb0060..552c7e0 100644
--- a/lib/Kolab/FreeBusy/Logger.php
+++ b/lib/Kolab/FreeBusy/Logger.php
@@ -2,6 +2,10 @@
namespace Kolab\FreeBusy;
+use Monolog\Logger as Monologger;
+use Monolog\Handler\StreamHandler;
+use Monolog\Handler\NullHandler;
+
/**
* Helper class for creating up Monolog instanced with local configration
*/
@@ -15,20 +19,20 @@ class Logger
public static function get($name, $level = 0)
{
if (!isset(self::$instances[$name])) {
- $logger = new \Monolog\Logger($name);
+ $logger = new Monologger($name);
// TODO: support more log drivers
$config = Config::getInstance();
switch ($config->get('log.driver')) {
case 'file':
$logdir = self::realpath($config->get('log.path'));
- $loglevel = $level ?: $config->get("log.level", \Monolog\Logger::INFO);
- $logger->pushHandler(new \Monolog\Handler\StreamHandler($logdir . $name. '.log', $loglevel));
+ $loglevel = $level ?: $config->get("log.level", Monologger::INFO);
+ $logger->pushHandler(new StreamHandler($logdir . $name. '.log', $loglevel));
break;
default:
// null handler if logging is disabled
- $logger->pushHandler(new \Monolog\Handler\NullHandler);
+ $logger->pushHandler(new NullHandler);
}
self::$instances[$name] = $logger;