Move Logger to the Application namespace

fixes #7148
This commit is contained in:
Eric Lippmann 2014-10-31 10:27:17 +01:00
parent 0bf6dc24a8
commit 16352fc10c
33 changed files with 45 additions and 47 deletions

View File

@ -9,7 +9,7 @@ use Icinga\Web\Controller\ActionController;
use Icinga\Form\Authentication\LoginForm; use Icinga\Form\Authentication\LoginForm;
use Icinga\Authentication\AuthChain; use Icinga\Authentication\AuthChain;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Exception\AuthenticationException; use Icinga\Exception\AuthenticationException;
use Icinga\Exception\NotReadableError; use Icinga\Exception\NotReadableError;
use Icinga\Exception\ConfigurationError; use Icinga\Exception\ConfigurationError;

View File

@ -3,7 +3,7 @@
// {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}}
use Icinga\Web\Url; use Icinga\Web\Url;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Config\PreservingIniWriter; use Icinga\Config\PreservingIniWriter;
use Icinga\Application\Config as IcingaConfig; use Icinga\Application\Config as IcingaConfig;
use Icinga\Web\Widget\Dashboard; use Icinga\Web\Widget\Dashboard;

View File

@ -4,7 +4,7 @@
// namespace Icinga\Application\Controllers; // namespace Icinga\Application\Controllers;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Web\Controller\ActionController; use Icinga\Web\Controller\ActionController;
use Icinga\Application\Icinga; use Icinga\Application\Icinga;

View File

@ -4,7 +4,7 @@
use Icinga\Web\Controller\ActionController; use Icinga\Web\Controller\ActionController;
use Icinga\Filter\Filter; use Icinga\Filter\Filter;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
/** /**
* Application wide interface for filtering * Application wide interface for filtering

View File

@ -5,9 +5,7 @@
use Icinga\Module\Monitoring\Controller; use Icinga\Module\Monitoring\Controller;
use Icinga\Web\Hook; use Icinga\Web\Hook;
use Icinga\Web\Url; use Icinga\Web\Url;
use Icinga\Data\ResourceFactory; use Icinga\Application\Logger;
use Icinga\Logger\Logger;
use Icinga\Logger\Writer\FileWriter;
use Icinga\Protocol\File\FileReader; use Icinga\Protocol\File\FileReader;
use \Zend_Controller_Action_Exception as ActionError; use \Zend_Controller_Action_Exception as ActionError;

View File

@ -4,7 +4,7 @@
use Icinga\Web\Controller\ActionController; use Icinga\Web\Controller\ActionController;
use Icinga\Application\Icinga; use Icinga\Application\Icinga;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Web\FileCache; use Icinga\Web\FileCache;
use Zend_Controller_Action_Exception as ActionException; use Zend_Controller_Action_Exception as ActionException;

View File

@ -5,7 +5,7 @@
namespace Icinga\Form\Config\General; namespace Icinga\Form\Config\General;
use Icinga\Application\Icinga; use Icinga\Application\Icinga;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\Validator\WritablePathValidator; use Icinga\Web\Form\Validator\WritablePathValidator;

View File

@ -6,7 +6,7 @@ namespace Icinga\Form;
use Exception; use Exception;
use DateTimeZone; use DateTimeZone;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\User\Preferences; use Icinga\User\Preferences;
use Icinga\User\Preferences\PreferencesStore; use Icinga\User\Preferences\PreferencesStore;
use Icinga\Util\TimezoneDetect; use Icinga\Util\TimezoneDetect;

View File

@ -11,7 +11,7 @@ use Icinga\Application\Modules\Manager as ModuleManager;
use Icinga\Data\ResourceFactory; use Icinga\Data\ResourceFactory;
use Icinga\Exception\ConfigurationError; use Icinga\Exception\ConfigurationError;
use Icinga\Exception\NotReadableError; use Icinga\Exception\NotReadableError;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Util\DateTimeFactory; use Icinga\Util\DateTimeFactory;
use Icinga\Util\Translator; use Icinga\Util\Translator;
use Icinga\Exception\IcingaException; use Icinga\Exception\IcingaException;

View File

@ -9,7 +9,7 @@ use Icinga\Application\ApplicationBootstrap;
use Icinga\Cli\Params; use Icinga\Cli\Params;
use Icinga\Cli\Loader; use Icinga\Cli\Loader;
use Icinga\Cli\Screen; use Icinga\Cli\Screen;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Application\Benchmark; use Icinga\Application\Benchmark;
use Icinga\Exception\ProgrammingError; use Icinga\Exception\ProgrammingError;
use Zend_Config; use Zend_Config;

View File

@ -2,13 +2,13 @@
// {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Logger; namespace Icinga\Application;
use Exception; use Exception;
use Zend_Config; use Zend_Config;
use Icinga\Application\Logger\Writer\FileWriter;
use Icinga\Application\Logger\Writer\SyslogWriter;
use Icinga\Exception\ConfigurationError; use Icinga\Exception\ConfigurationError;
use Icinga\Logger\Writer\FileWriter;
use Icinga\Logger\Writer\SyslogWriter;
/** /**
* Logger * Logger
@ -57,7 +57,7 @@ class Logger
/** /**
* Log writer * Log writer
* *
* @var \Icinga\Logger\LogWriter * @var \Icinga\Application\Logger\LogWriter
*/ */
protected $writer; protected $writer;
@ -133,12 +133,12 @@ class Logger
* *
* @param Zend_Config $config The configuration to initialize the writer with * @param Zend_Config $config The configuration to initialize the writer with
* *
* @return \Icinga\Logger\LogWriter The requested log writer * @return \Icinga\Application\Logger\LogWriter The requested log writer
* @throws ConfigurationError If the requested writer cannot be found * @throws ConfigurationError If the requested writer cannot be found
*/ */
protected function createWriter(Zend_Config $config) protected function createWriter(Zend_Config $config)
{ {
$class = 'Icinga\\Logger\\Writer\\' . ucfirst(strtolower($config->log)) . 'Writer'; $class = 'Icinga\\Application\\Logger\\Writer\\' . ucfirst(strtolower($config->log)) . 'Writer';
if (! class_exists($class)) { if (! class_exists($class)) {
throw new ConfigurationError( throw new ConfigurationError(
'Cannot find log writer of type "%s"', 'Cannot find log writer of type "%s"',
@ -258,7 +258,7 @@ class Logger
/** /**
* Get the log writer to use * Get the log writer to use
* *
* @return \Icinga\Logger\LogWriter * @return \Icinga\Application\Logger\LogWriter
*/ */
public function getWriter() public function getWriter()
{ {

View File

@ -2,7 +2,7 @@
// {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Logger; namespace Icinga\Application\Logger;
use Zend_Config; use Zend_Config;

View File

@ -2,13 +2,13 @@
// {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Logger\Writer; namespace Icinga\Application\Logger\Writer;
use Exception; use Exception;
use Zend_Config; use Zend_Config;
use Icinga\Application\Logger;
use Icinga\Application\Logger\LogWriter;
use Icinga\Exception\ConfigurationError; use Icinga\Exception\ConfigurationError;
use Icinga\Logger\Logger;
use Icinga\Logger\LogWriter;
use Icinga\Util\File; use Icinga\Util\File;
/** /**

View File

@ -2,11 +2,11 @@
// {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Logger\Writer; namespace Icinga\Application\Logger\Writer;
use Zend_Config; use Zend_Config;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Logger\LogWriter; use Icinga\Application\Logger\LogWriter;
/** /**
* Log to the syslog service * Log to the syslog service

View File

@ -6,7 +6,7 @@ namespace Icinga\Application\Modules;
use Icinga\Application\ApplicationBootstrap; use Icinga\Application\ApplicationBootstrap;
use Icinga\Application\Icinga; use Icinga\Application\Icinga;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Data\DataArray\ArrayDatasource; use Icinga\Data\DataArray\ArrayDatasource;
use Icinga\Data\SimpleQuery; use Icinga\Data\SimpleQuery;
use Icinga\Exception\ConfigurationError; use Icinga\Exception\ConfigurationError;

View File

@ -12,7 +12,7 @@ use Zend_Controller_Router_Route_Regex as RegexRoute;
use Icinga\Application\ApplicationBootstrap; use Icinga\Application\ApplicationBootstrap;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Application\Icinga; use Icinga\Application\Icinga;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Util\Translator; use Icinga\Util\Translator;
use Icinga\Web\Hook; use Icinga\Web\Hook;
use Icinga\Web\Menu; use Icinga\Web\Menu;

View File

@ -9,7 +9,7 @@ require_once __DIR__ . '/ApplicationBootstrap.php';
use Icinga\Authentication\Manager as AuthenticationManager; use Icinga\Authentication\Manager as AuthenticationManager;
use Icinga\Exception\ConfigurationError; use Icinga\Exception\ConfigurationError;
use Icinga\Exception\NotReadableError; use Icinga\Exception\NotReadableError;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Util\TimezoneDetect; use Icinga\Util\TimezoneDetect;
use Icinga\Web\Request; use Icinga\Web\Request;
use Icinga\Web\Response; use Icinga\Web\Response;

View File

@ -6,7 +6,7 @@ namespace Icinga\Authentication;
use Iterator; use Iterator;
use Zend_Config; use Zend_Config;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Exception\ConfigurationError; use Icinga\Exception\ConfigurationError;
/** /**

View File

@ -4,7 +4,7 @@
namespace Icinga\Authentication\Backend; namespace Icinga\Authentication\Backend;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\User; use Icinga\User;
use Icinga\Authentication\UserBackend; use Icinga\Authentication\UserBackend;
use Icinga\Protocol\Ldap\Connection; use Icinga\Protocol\Ldap\Connection;

View File

@ -9,7 +9,7 @@ use Zend_Config;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Exception\IcingaException; use Icinga\Exception\IcingaException;
use Icinga\Exception\NotReadableError; use Icinga\Exception\NotReadableError;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\User; use Icinga\User;
use Icinga\User\Preferences; use Icinga\User\Preferences;
use Icinga\User\Preferences\PreferencesStore; use Icinga\User\Preferences\PreferencesStore;

View File

@ -7,7 +7,7 @@ namespace Icinga\Protocol\Ldap;
use Icinga\Protocol\Ldap\Exception as LdapException; use Icinga\Protocol\Ldap\Exception as LdapException;
use Icinga\Application\Platform; use Icinga\Application\Platform;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Zend_Config; use Zend_Config;
/** /**

View File

@ -5,7 +5,7 @@
namespace Icinga\Web; namespace Icinga\Web;
use Exception; use Exception;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Exception\ProgrammingError; use Icinga\Exception\ProgrammingError;
/** /**

View File

@ -9,7 +9,7 @@ use RecursiveIterator;
use Zend_Config; use Zend_Config;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Application\Icinga; use Icinga\Application\Icinga;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Exception\ConfigurationError; use Icinga\Exception\ConfigurationError;
use Icinga\Exception\ProgrammingError; use Icinga\Exception\ProgrammingError;
use Icinga\Web\Url; use Icinga\Web\Url;

View File

@ -6,7 +6,7 @@ namespace Icinga\Web;
use Exception; use Exception;
use RecursiveIteratorIterator; use RecursiveIteratorIterator;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
/** /**
* A renderer to draw a menu with its sub-menus using an unordered html list * A renderer to draw a menu with its sub-menus using an unordered html list

View File

@ -6,7 +6,7 @@ namespace Icinga\Web;
use Icinga\Exception\ProgrammingError; use Icinga\Exception\ProgrammingError;
use Icinga\Application\Platform; use Icinga\Application\Platform;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Web\Session; use Icinga\Web\Session;
/** /**

View File

@ -4,7 +4,7 @@
namespace Icinga\Web\Session; namespace Icinga\Web\Session;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Exception\ConfigurationError; use Icinga\Exception\ConfigurationError;
/** /**

View File

@ -7,7 +7,7 @@ namespace Icinga\Web\Widget\Chart;
use Icinga\Web\Widget\AbstractWidget; use Icinga\Web\Widget\AbstractWidget;
use Icinga\Web\Url; use Icinga\Web\Url;
use Icinga\Util\Format; use Icinga\Util\Format;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
/** /**
* A SVG-PieChart intended to be displayed as a small icon next to labels, to offer a better visualization of the * A SVG-PieChart intended to be displayed as a small icon next to labels, to offer a better visualization of the

View File

@ -4,7 +4,7 @@
use Icinga\Application\Icinga; use Icinga\Application\Icinga;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Module\Monitoring\Form\Command\DisableNotificationWithExpireForm; use Icinga\Module\Monitoring\Form\Command\DisableNotificationWithExpireForm;
use Icinga\Module\Monitoring\Form\Command\SingleArgumentCommandForm; use Icinga\Module\Monitoring\Form\Command\SingleArgumentCommandForm;
use Icinga\Web\Form; use Icinga\Web\Form;

View File

@ -4,7 +4,7 @@
namespace Icinga\Module\Monitoring\Backend\Ido\Query; namespace Icinga\Module\Monitoring\Backend\Ido\Query;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Zend_Db_Select; use Zend_Db_Select;
class GroupSummaryQuery extends IdoQuery class GroupSummaryQuery extends IdoQuery

View File

@ -5,7 +5,7 @@
namespace Icinga\Module\Monitoring\Backend\Ido\Query; namespace Icinga\Module\Monitoring\Backend\Ido\Query;
use Icinga\Exception\IcingaException; use Icinga\Exception\IcingaException;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Data\Db\DbQuery; use Icinga\Data\Db\DbQuery;
use Icinga\Exception\ProgrammingError; use Icinga\Exception\ProgrammingError;
use Icinga\Application\Icinga; use Icinga\Application\Icinga;

View File

@ -6,7 +6,7 @@ namespace Icinga\Module\Monitoring\Command\Transport;
use Exception; use Exception;
use LogicException; use LogicException;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Module\Monitoring\Command\Exception\TransportException; use Icinga\Module\Monitoring\Command\Exception\TransportException;
use Icinga\Module\Monitoring\Command\IcingaCommand; use Icinga\Module\Monitoring\Command\IcingaCommand;
use Icinga\Module\Monitoring\Command\Renderer\IcingaCommandFileCommandRenderer; use Icinga\Module\Monitoring\Command\Renderer\IcingaCommandFileCommandRenderer;

View File

@ -5,7 +5,7 @@
namespace Icinga\Module\Monitoring\Command\Transport; namespace Icinga\Module\Monitoring\Command\Transport;
use LogicException; use LogicException;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Module\Monitoring\Command\Exception\TransportException; use Icinga\Module\Monitoring\Command\Exception\TransportException;
use Icinga\Module\Monitoring\Command\IcingaCommand; use Icinga\Module\Monitoring\Command\IcingaCommand;
use Icinga\Module\Monitoring\Command\Renderer\IcingaCommandFileCommandRenderer; use Icinga\Module\Monitoring\Command\Renderer\IcingaCommandFileCommandRenderer;

View File

@ -5,9 +5,9 @@
namespace Tests\Icinga\Logger\Writer; namespace Tests\Icinga\Logger\Writer;
use Zend_Config; use Zend_Config;
use Icinga\Logger\Logger; use Icinga\Application\Logger;
use Icinga\Application\Logger\Writer\FileWriter;
use Icinga\Test\BaseTestCase; use Icinga\Test\BaseTestCase;
use Icinga\Logger\Writer\FileWriter;
class StreamWriterTest extends BaseTestCase class StreamWriterTest extends BaseTestCase
{ {