本文整理汇总了PHP中CakeLog::drop方法的典型用法代码示例。如果您正苦于以下问题:PHP CakeLog::drop方法的具体用法?PHP CakeLog::drop怎么用?PHP CakeLog::drop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CakeLog
的用法示例。
在下文中一共展示了CakeLog::drop方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
/**
* Restores everything back to normal
*
* @return void
**/
public function tearDown()
{
parent::tearDown();
CakeLog::enable('stderr');
CakeLog::drop('queuetest');
Configure::write('SQS', array());
unset($this->logger);
}
示例2: tearDown
/**
* Restores everything back to normal
*
* @return void
**/
public function tearDown()
{
parent::tearDown();
GearmanQueue::client(false);
CakeLog::enable('stderr');
CakeLog::drop('queuetest');
Configure::write('Gearman', array());
unset($this->logger);
}
示例3: tearDown
/**
* Restores everything back to normal
*
* @return void
**/
public function tearDown()
{
parent::tearDown();
Nodes\Environment::setRoot($this->_root);
GearmanQueue::config(array('servers' => array('127.0.0.1')));
GearmanQueue::client(false);
CakeLog::enable('stderr');
CakeLog::drop('queuetest');
unset($this->logger);
}
示例4: setUp
/**
* setUp
*
* @return void
*/
public function setUp()
{
parent::setUp();
App::build(array('Plugin' => array(TESTS . 'test_app' . DS . 'Plugin' . DS), 'View' => array(TESTS . 'test_app' . DS . 'View' . DS)), App::PREPEND);
if (!isset($_SERVER['REMOTE_ADDR'])) {
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
}
CakePlugin::unload('Install');
CakePlugin::load(array('Users'), array('bootstrap' => true));
CakePlugin::load('Example');
Configure::write('Acl.database', 'test');
$Setting = ClassRegistry::init('Settings.Setting');
$Setting->settingsPath = TESTS . 'test_app' . DS . 'Config' . DS . 'settings.json';
Configure::drop('settings');
Configure::config('settings', new CroogoJsonReader(dirname($Setting->settingsPath) . DS));
CakeLog::drop('stdout');
CakeLog::drop('stderr');
$Setting->writeConfiguration();
}
示例5: testSendWithLog
/**
* testSendWithLog method
*
* @return void
*/
public function testSendWithLog() {
$path = CAKE . 'Test' . DS . 'test_app' . DS . 'tmp' . DS;
CakeLog::config('email', array(
'engine' => 'FileLog',
'path' => TMP
));
CakeLog::drop('default');
$this->CakeEmail->transport('Debug');
$this->CakeEmail->to('me@cakephp.org');
$this->CakeEmail->from('cake@cakephp.org');
$this->CakeEmail->subject('My title');
$this->CakeEmail->config(array('log' => 'cake_test_emails'));
$result = $this->CakeEmail->send("Logging This");
App::uses('File', 'Utility');
$File = new File(TMP . 'cake_test_emails.log');
$log = $File->read();
$this->assertTrue(strpos($log, $result['headers']) !== false);
$this->assertTrue(strpos($log, $result['message']) !== false);
$File->delete();
CakeLog::drop('email');
}
示例6: _useLogger
/**
* Used to enable or disable logging stream output to stdout and stderr
* If you don't wish to see in your stdout or stderr everything that is logged
* through CakeLog, call this function with first param as false
*
* @param boolean $enable whether to enable CakeLog output or not
* @return void
*/
protected function _useLogger($enable = true)
{
if (!$enable) {
CakeLog::drop('stdout');
CakeLog::drop('stderr');
return;
}
CakeLog::config('stdout', array('engine' => 'Console', 'types' => array('notice', 'info'), 'stream' => $this->stdout));
CakeLog::config('stderr', array('engine' => 'Console', 'types' => array('emergency', 'alert', 'critical', 'error', 'warning', 'debug'), 'stream' => $this->stderr));
}
示例7: testDrop
/**
* explict tests for drop()
*
* @return void
**/
function testDrop() {
CakeLog::config('file', array(
'engine' => 'FileLog',
'path' => LOGS
));
$result = CakeLog::configured();
$this->assertEqual($result, array('file'));
CakeLog::drop('file');
$result = CakeLog::configured();
$this->assertEqual($result, array());
}
示例8: testProtectedUseLogger
/**
* Tests that _useLogger works properly
*
* @return void
*/
public function testProtectedUseLogger()
{
CakeLog::drop('stdout');
CakeLog::drop('stderr');
$this->Shell->useLogger(true);
$this->assertNotEmpty(CakeLog::stream('stdout'));
$this->assertNotEmpty(CakeLog::stream('stderr'));
$this->Shell->useLogger(false);
$this->assertFalse(CakeLog::stream('stdout'));
$this->assertFalse(CakeLog::stream('stderr'));
}
示例9: _useLogger
/**
* Used to enable or disable logging stream output to stdout and stderr
* If you don't wish to see in your stdout or stderr everything that is logged
* through CakeLog, call this function with first param as false
*
* @param bool $enable whether to enable CakeLog output or not
* @return void
*/
protected function _useLogger($enable = true)
{
if (!$enable) {
CakeLog::drop('stdout');
CakeLog::drop('stderr');
return;
}
if (!$this->_loggerIsConfigured("stdout")) {
$this->_configureStdOutLogger();
}
if (!$this->_loggerIsConfigured("stderr")) {
$this->_configureStdErrLogger();
}
}
示例10: testLogPanelConstructCreatingDefaultLogConfiguration
/**
* test that creating the log panel creates the default file logger if none
* are configured. This stops DebugKit from mucking with the default auto-magic log config
*
* @return void
*/
public function testLogPanelConstructCreatingDefaultLogConfiguration() {
$this->_loadController();
CakeLog::drop('default');
CakeLog::drop('debug_kit_log_panel');
$panel = new LogPanel(array());
$configured = CakeLog::configured();
$this->assertTrue(in_array('default', $configured));
$this->assertTrue(in_array('debug_kit_log_panel', $configured));
}
示例11: testCustomLevelWrites
/**
* Test writing log files with custom levels
*
* @return void
*/
public function testCustomLevelWrites()
{
$this->_deleteLogs();
$this->_resetLogConfig();
CakeLog::levels(array('spam', 'eggs'));
$testMessage = 'error message';
CakeLog::write('error', $testMessage);
CakeLog::defaultLevels();
$this->assertTrue(file_exists(LOGS . 'error.log'));
$contents = file_get_contents(LOGS . 'error.log');
$this->assertContains('Error: ' . $testMessage, $contents);
CakeLog::config('spam', array('engine' => 'File', 'file' => 'spam.log', 'types' => 'spam'));
CakeLog::config('eggs', array('engine' => 'File', 'file' => 'eggs.log', 'types' => array('spam', 'eggs')));
$testMessage = 'spam message';
CakeLog::write('spam', $testMessage);
CakeLog::defaultLevels();
$this->assertTrue(file_exists(LOGS . 'spam.log'));
$this->assertTrue(file_exists(LOGS . 'eggs.log'));
$contents = file_get_contents(LOGS . 'spam.log');
$this->assertContains('Spam: ' . $testMessage, $contents);
$testMessage = 'egg message';
CakeLog::write('eggs', $testMessage);
CakeLog::defaultLevels();
$contents = file_get_contents(LOGS . 'spam.log');
$this->assertNotContains('Eggs: ' . $testMessage, $contents);
$contents = file_get_contents(LOGS . 'eggs.log');
$this->assertContains('Eggs: ' . $testMessage, $contents);
CakeLog::drop('spam');
CakeLog::drop('eggs');
$this->_deleteLogs();
}
示例12: testSendWithLogAndScope
/**
* testSendWithLogAndScope method
*
* @return void
*/
public function testSendWithLogAndScope()
{
CakeLog::config('email', array('engine' => 'File', 'path' => TMP, 'types' => array('cake_test_emails'), 'scopes' => array('email')));
CakeLog::drop('default');
$this->CakeEmail->transport('Debug');
$this->CakeEmail->to('me@cakephp.org');
$this->CakeEmail->from('cake@cakephp.org');
$this->CakeEmail->subject('My title');
$this->CakeEmail->config(array('log' => array('level' => 'cake_test_emails', 'scope' => 'email')));
$result = $this->CakeEmail->send("Logging This");
App::uses('File', 'Utility');
$File = new File(TMP . 'cake_test_emails.log');
$log = $File->read();
$this->assertTrue(strpos($log, $result['headers']) !== FALSE);
$this->assertTrue(strpos($log, $result['message']) !== FALSE);
$File->delete();
CakeLog::drop('email');
}