Permalink
Browse files

Renaming method so they match those in Cache.

Removing method that was missed during previous refactor.
Updating tests.
  • Loading branch information...
1 parent fb483e9 commit be9f0ec4c7156c92e1454b99667c82753a97c1ec @markstory markstory committed Nov 15, 2009
Showing with 10 additions and 34 deletions.
  1. +4 −28 cake/libs/cake_log.php
  2. +6 −6 cake/tests/cases/libs/cake_log.test.php
View
@@ -19,15 +19,6 @@
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-
-/**
- * Included libraries.
- *
- */
- if (!class_exists('File')) {
- require LIBS . 'file.php';
- }
-
/**
* Set up error level constants to be used within the framework if they are not defined within the
* system.
@@ -140,40 +131,25 @@ function _getLogger($loggerName) {
* @return array
* @static
*/
- function streams() {
+ function configured() {
$self = CakeLog::getInstance();
return array_keys($self->_streams);
}
/**
- * Remove a stream from the active streams. Once a stream has been removed
- * it will no longer be called.
+ * Removes a stream from the active streams. Once a stream has been removed
+ * it will no longer have messages sent to it.
*
* @param string $keyname Key name of callable to remove.
* @return void
* @static
*/
- function remove($streamName) {
+ function drop($streamName) {
$self = CakeLog::getInstance();
unset($self->_streams[$streamName]);
}
/**
- * Add a stream the logger.
- * Streams represent destinations for log messages. Each stream can connect to
- * a different resource /interface and capture/write output to that source.
- *
- * @param string $key Keyname of config.
- * @param array $config Array of config information for the LogStream
- * @return boolean success
- * @static
- */
- function addStream($key, $config) {
- $self = CakeLog::getInstance();
- $self->_streams[$key] = $config;
- }
-
-/**
* Configures the automatic/default stream a FileLog.
*
* @return void
@@ -34,9 +34,9 @@ class CakeLogTest extends CakeTestCase {
* @return void
*/
function startTest() {
- $streams = CakeLog::streams();
+ $streams = CakeLog::configured();
foreach ($streams as $stream) {
- CakeLog::remove($stream);
+ CakeLog::drop($stream);
}
}
@@ -55,13 +55,13 @@ function testImportingLoggers() {
'engine' => 'TestAppLog'
));
$this->assertTrue($result);
- $this->assertEqual(CakeLog::streams(), array('libtest'));
+ $this->assertEqual(CakeLog::configured(), array('libtest'));
$result = CakeLog::config('plugintest', array(
'engine' => 'TestPlugin.TestPluginLog'
));
$this->assertTrue($result);
- $this->assertEqual(CakeLog::streams(), array('libtest', 'plugintest'));
+ $this->assertEqual(CakeLog::configured(), array('libtest', 'plugintest'));
App::build();
}
@@ -93,7 +93,7 @@ function testAutoConfig() {
CakeLog::write(LOG_WARNING, 'Test warning');
$this->assertTrue(file_exists(LOGS . 'error.log'));
- $result = CakeLog::streams();
+ $result = CakeLog::configured();
$this->assertEqual($result, array('default'));
unlink(LOGS . 'error.log');
}
@@ -108,7 +108,7 @@ function testConfig() {
'engine' => 'FileLog',
'path' => LOGS
));
- $result = CakeLog::streams();
+ $result = CakeLog::configured();
$this->assertEqual($result, array('file'));
@unlink(LOGS . 'error.log');

0 comments on commit be9f0ec

Please sign in to comment.