当前位置: 首页>>代码示例>>PHP>>正文


PHP Log::drop方法代码示例

本文整理汇总了PHP中Cake\Log\Log::drop方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::drop方法的具体用法?PHP Log::drop怎么用?PHP Log::drop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cake\Log\Log的用法示例。


在下文中一共展示了Log::drop方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 /**
  * setup, create mocks
  *
  * @return Mock object
  */
 public function setUp()
 {
     parent::setUp();
     $this->stderr = $this->getMock('Cake\\Console\\ConsoleOutput', [], [], '', false);
     $this->Error = $this->getMock('Cake\\Console\\ConsoleErrorHandler', ['_stop'], [['stderr' => $this->stderr]]);
     Log::drop('stderr');
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:12,代码来源:ConsoleErrorHandlerTest.php

示例2: setUp

 /**
  * setup, create mocks
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->stderr = $this->getMockBuilder('Cake\\Console\\ConsoleOutput')->disableOriginalConstructor()->getMock();
     $this->Error = $this->getMockBuilder('Cake\\Console\\ConsoleErrorHandler')->setMethods(['_stop'])->setConstructorArgs([['stderr' => $this->stderr]])->getMock();
     Log::drop('stderr');
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:12,代码来源:ConsoleErrorHandlerTest.php

示例3: main

 /**
  * Start the shell and interactive console.
  *
  * @return int|void
  */
 public function main()
 {
     if (!class_exists('Psy\\Shell')) {
         $this->err('<error>Unable to load Psy\\Shell.</error>');
         $this->err('');
         $this->err('Make sure you have installed psysh as a dependency,');
         $this->err('and that Psy\\Shell is registered in your autoloader.');
         $this->err('');
         $this->err('If you are using composer run');
         $this->err('');
         $this->err('<info>$ php composer.phar require --dev psy/psysh</info>');
         $this->err('');
         return 1;
     }
     $this->out("You can exit with <info>`CTRL-C`</info> or <info>`exit`</info>");
     $this->out('');
     Log::drop('debug');
     Log::drop('error');
     $this->_io->setLoggers(false);
     restore_error_handler();
     restore_exception_handler();
     $psy = new PsyShell();
     $psy->run();
     return 0;
 }
开发者ID:bostontrader,项目名称:acctwerx,代码行数:30,代码来源:ConsoleShell.php

示例4: main

 /**
  * Start the shell and interactive console.
  *
  * @return void
  */
 public function main()
 {
     if (!class_exists('Boris\\Boris')) {
         $this->err('<error>Unable to load Boris\\Boris.</error>');
         $this->err('');
         $this->err('Make sure you have installed boris as a dependency,');
         $this->err('and that Boris\\Boris is registered in your autoloader.');
         $this->err('');
         $this->err('If you are using composer run');
         $this->err('');
         $this->err('<info>$ php composer.phar require d11wtq/boris</info>');
         $this->err('');
         return 1;
     }
     if (!function_exists('pcntl_signal')) {
         $this->err('<error>No process control functions.</error>');
         $this->err('');
         $this->err('You are missing the pcntl extension, the interactive console requires this extension.');
         return 2;
     }
     $this->out('You can exit with <info>CTRL-D</info>');
     Log::drop('debug');
     Log::drop('error');
     $this->_io->setLoggers(false);
     restore_error_handler();
     restore_exception_handler();
     $boris = new Boris('app > ');
     $boris->start();
 }
开发者ID:franky0930,项目名称:MarketingConnex,代码行数:34,代码来源:ConsoleShell.php

示例5: tearDown

 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     Log::drop('email');
     Email::drop('test');
     Email::dropTransport('debug');
     Email::dropTransport('test_smtp');
 }
开发者ID:dereuromark,项目名称:cakephp-tools,代码行数:13,代码来源:EmailTest.php

示例6: main

 /**
  * Start the shell and interactive console.
  *
  * @return void
  */
 public function main()
 {
     if (!class_exists('Boris\\Boris')) {
         $this->err('<error>Unable to load Boris\\Boris.</error>');
         $this->err('');
         $this->err('Make sure you have installed boris as a dependency,');
         $this->err('and that Boris\\Boris is registered in your autoloader.');
         $this->err('');
         $this->err('If you are using composer run');
         $this->err('');
         $this->err('<info>$ php composer.phar require d11wtq/boris</info>');
         $this->err('');
         return 1;
     }
     $this->out('You can exit with <info>CTRL-D</info>');
     Log::drop('debug');
     Log::drop('error');
     restore_error_handler();
     restore_exception_handler();
     $boris = new Boris('app > ');
     $boris->start();
 }
开发者ID:vpolpeta,项目名称:crud-demo-app,代码行数:27,代码来源:ConsoleShell.php

示例7: testWriteUnhandled

 /**
  * Test that write() returns false on an unhandled message.
  *
  * @return void
  */
 public function testWriteUnhandled()
 {
     Log::drop('error');
     Log::drop('debug');
     $result = Log::write('error', 'Bad stuff', 'unpossible');
     $this->assertFalse($result);
 }
开发者ID:Slayug,项目名称:castor,代码行数:12,代码来源:LogTest.php

示例8: setLoggers

 /**
  * Connects or disconnects the loggers to the console output.
  *
  * Used to enable or disable logging stream output to stdout and stderr
  * If you don't wish all log output in stdout or stderr
  * through Cake's Log class, call this function with `$enable=false`.
  *
  * @param int|bool $enable Use a boolean to enable/toggle all logging. Use
  *   one of the verbosity constants (self::VERBOSE, self::QUIET, self::NORMAL)
  *   to control logging levels. VERBOSE enables debug logs, NORMAL does not include debug logs,
  *   QUIET disables notice, info and debug logs.
  * @return void
  */
 public function setLoggers($enable)
 {
     Log::drop('stdout');
     Log::drop('stderr');
     if ($enable === false) {
         return;
     }
     $outLevels = ['notice', 'info'];
     if ($enable === static::VERBOSE || $enable === true) {
         $outLevels[] = 'debug';
     }
     if ($enable !== static::QUIET) {
         $stdout = new ConsoleLog(['types' => $outLevels, 'stream' => $this->_out]);
         Log::config('stdout', ['engine' => $stdout]);
     }
     $stderr = new ConsoleLog(['types' => ['emergency', 'alert', 'critical', 'error', 'warning'], 'stream' => $this->_err]);
     Log::config('stderr', ['engine' => $stderr]);
 }
开发者ID:hossain-seaos,项目名称:cakephp,代码行数:31,代码来源:ConsoleIo.php

示例9: testSetLoggersVerbose

 /**
  * Tests that setLoggers works properly with verbose
  *
  * @return void
  */
 public function testSetLoggersVerbose()
 {
     Log::drop('stdout');
     Log::drop('stderr');
     $this->io->setLoggers(ConsoleIo::VERBOSE);
     $this->assertNotEmpty(Log::engine('stderr'));
     $engine = Log::engine('stdout');
     $this->assertEquals(['notice', 'info', 'debug'], $engine->config('levels'));
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:14,代码来源:ConsoleIoTest.php

示例10: testSetLoggers

 /**
  * Tests that setLoggers works properly
  *
  * @return void
  */
 public function testSetLoggers()
 {
     Log::drop('stdout');
     Log::drop('stderr');
     $this->io->setLoggers(true);
     $this->assertNotEmpty(Log::engine('stdout'));
     $this->assertNotEmpty(Log::engine('stderr'));
     $this->io->setLoggers(false);
     $this->assertFalse(Log::engine('stdout'));
     $this->assertFalse(Log::engine('stderr'));
 }
开发者ID:alexunique0519,项目名称:Blog_Cakephp_association,代码行数:16,代码来源:ConsoleIoTest.php

示例11: setLoggers

 /**
  * Connects or disconnects the loggers to the console output.
  *
  * Used to enable or disable logging stream output to stdout and stderr
  * If you don't wish all log output in stdout or stderr
  * through Cake's Log class, call this function with `$enable=false`.
  *
  * @param bool $enable Whether you want loggers on or off.
  * @return void
  */
 public function setLoggers($enable)
 {
     Log::drop('stdout');
     Log::drop('stderr');
     if (!$enable) {
         return;
     }
     $stdout = new ConsoleLog(['types' => ['notice', 'info', 'debug'], 'stream' => $this->_out]);
     Log::config('stdout', ['engine' => $stdout]);
     $stderr = new ConsoleLog(['types' => ['emergency', 'alert', 'critical', 'error', 'warning'], 'stream' => $this->_err]);
     Log::config('stderr', ['engine' => $stderr]);
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:22,代码来源:ConsoleIo.php

示例12: tearDown

 public function tearDown()
 {
     parent::tearDown();
     Log::drop('trait_test');
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:5,代码来源:LogTraitTest.php

示例13: tearDown

 /**
  * Teardown method.
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     Log::drop('debug_kit_log_panel');
 }
开发者ID:meotimdihia,项目名称:cakephp-test-elasticsearch,代码行数:10,代码来源:LogPanelTest.php

示例14: testLog

 /**
  * testLog method
  *
  * @return void
  */
 public function testLog()
 {
     $mock = $this->getMock('Cake\\Log\\Engine\\BaseLog', ['log']);
     Log::config('test', ['engine' => $mock]);
     $mock->expects($this->at(0))->method('log')->with('debug', $this->logicalAnd($this->stringContains('DebuggerTest::testLog'), $this->stringContains('cool')));
     $mock->expects($this->at(1))->method('log')->with('debug', $this->logicalAnd($this->stringContains('DebuggerTest::testLog'), $this->stringContains('[main]'), $this->stringContains("'whatever',"), $this->stringContains("'here'")));
     Debugger::log('cool');
     Debugger::log(['whatever', 'here']);
     Log::drop('test');
 }
开发者ID:alexunique0519,项目名称:Blog_Cakephp_association,代码行数:15,代码来源:DebuggerTest.php

示例15: function

 * Connect middleware/dispatcher filters.
 */
DispatcherFactory::add('Asset');
DispatcherFactory::add('Routing');
DispatcherFactory::add('ControllerFactory');
/**
 * Cakebox: use Monolog to create a combined log (with all log levels) to enable
 * Logstash > Elasticsearch forwarding, unless we are in CLI mode which defines
 * it's own Monlog logger (with 'cli' prefix tag instead of 'app').
 *
 * Notes:
 * - will log to /var/logs/cakephp if available so it can be parsed by Logstash
 * - LogStashFormatter argument is used as Logstash/Elasticsearch "type"
 * - Logger second argument is used as Monolog "channel"
 */
if (!$isCli) {
    Log::config('default', function () {
        if (is_writable('/var/log/cakephp')) {
            $handler = new StreamHandler('/var/log/cakephp/cakebox.log');
        } else {
            $handler = new StreamHandler(LOGS . DS . 'cakebox.log');
        }
        $formatter = new LogstashFormatter('cakephp');
        $handler->setFormatter($formatter);
        $log = new Logger('app.cakebox', array($handler));
        return $log;
    });
    // Stop using the now redundant default CakePHP file loggers
    Log::drop('debug');
    Log::drop('error');
}
开发者ID:alt3,项目名称:cakebox-console,代码行数:31,代码来源:bootstrap.php


注:本文中的Cake\Log\Log::drop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。