當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CakeLog::enable方法代碼示例

本文整理匯總了PHP中CakeLog::enable方法的典型用法代碼示例。如果您正苦於以下問題:PHP CakeLog::enable方法的具體用法?PHP CakeLog::enable怎麽用?PHP CakeLog::enable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CakeLog的用法示例。


在下文中一共展示了CakeLog::enable方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
 }
開發者ID:dilab,項目名稱:cakephp-sqs,代碼行數:13,代碼來源:SimpleQueueTest.php

示例2: tearDown

/**
 * tearDown
 *
 * @return void
 */
	public function tearDown() {
		parent::tearDown();
		if ($this->_restoreError) {
			restore_error_handler();
		}
		CakeLog::enable('stdout');
		CakeLog::enable('stderr');
	}
開發者ID:hungnt88,項目名稱:5stars-1,代碼行數:13,代碼來源:ErrorHandlerTest.php

示例3: 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);
 }
開發者ID:lorenzo,項目名稱:cakephp-gearman,代碼行數:14,代碼來源:GearmanQueueTest.php

示例4: 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);
 }
開發者ID:nodesagency,項目名稱:Platform-Common-Plugin,代碼行數:15,代碼來源:GearmanQueueTest.php

示例5: testLogError

 /**
  * test LogError()
  *
  * @return void
  */
 public function testLogError()
 {
     @unlink(LOGS . 'error.log');
     // disable stderr output for this test
     if (CakeLog::stream('stderr')) {
         CakeLog::disable('stderr');
     }
     LogError('Testing LogError() basic function');
     LogError("Testing with\nmulti-line\nstring");
     if (CakeLog::stream('stderr')) {
         CakeLog::enable('stderr');
     }
     $result = file_get_contents(LOGS . 'error.log');
     $this->assertRegExp('/Error: Testing LogError\\(\\) basic function/', $result);
     $this->assertNotRegExp("/Error: Testing with\nmulti-line\nstring/", $result);
     $this->assertRegExp('/Error: Testing with multi-line string/', $result);
 }
開發者ID:pritten,項目名稱:SmartCitizen.me,代碼行數:22,代碼來源:BasicsTest.php

示例6: testStreamDisable

 /**
  * test disable
  *
  * @expectedException CakeLogException
  * @return void
  */
 public function testStreamDisable()
 {
     CakeLog::config('spam', array('engine' => 'File', 'file' => 'spam'));
     $this->assertTrue(CakeLog::enabled('spam'));
     CakeLog::disable('spam');
     $this->assertFalse(CakeLog::enabled('spam'));
     CakeLog::drop('spam');
     CakeLog::enable('bogus_stream');
 }
開發者ID:yuuicchan0912,項目名稱:sample1,代碼行數:15,代碼來源:CakeLogTest.php

示例7: testFileAndConsoleLogging

 /**
  * Test file and console and logging
  *
  * @return void
  */
 public function testFileAndConsoleLogging()
 {
     CakeLog::disable('stdout');
     CakeLog::disable('stderr');
     // file logging
     $this->Shell->log_something();
     $this->assertTrue(file_exists(LOGS . 'error.log'));
     unlink(LOGS . 'error.log');
     $this->assertFalse(file_exists(LOGS . 'error.log'));
     // both file and console logging
     require_once CORE_TEST_CASES . DS . 'Log' . DS . 'Engine' . DS . 'ConsoleLogTest.php';
     $mock = $this->getMock('ConsoleLog', array('write'), array(array('types' => 'error')));
     TestCakeLog::config('console', array('engine' => 'Console', 'stream' => 'php://stderr'));
     TestCakeLog::replace('console', $mock);
     $mock->expects($this->once())->method('write')->with('error', $this->Shell->testMessage);
     $this->Shell->log_something();
     $this->assertTrue(file_exists(LOGS . 'error.log'));
     $contents = file_get_contents(LOGS . 'error.log');
     $this->assertContains($this->Shell->testMessage, $contents);
     CakeLog::enable('stdout');
     CakeLog::enable('stderr');
 }
開發者ID:hodrigohamalho,項目名稱:cakephp-ex,代碼行數:27,代碼來源:ShellTest.php


注:本文中的CakeLog::enable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。