本文整理汇总了PHP中Slim::getLog方法的典型用法代码示例。如果您正苦于以下问题:PHP Slim::getLog方法的具体用法?PHP Slim::getLog怎么用?PHP Slim::getLog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Slim
的用法示例。
在下文中一共展示了Slim::getLog方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSlimLoggerInMode
/**
* Test Slim Logging for given mode
*
* Pre-conditions:
* Slim app instantiated;
* Set custom Logger for current app mode;
*
* Post-conditions:
* Slim app Logger correct based on mode;
*/
public function testSlimLoggerInMode()
{
$app = new Slim(array('mode' => 'test'));
$app->configureMode('test', function () use($app) {
$app->config(array('log.enable' => true, 'log.logger' => new CustomLogger()));
});
$app->configureMode('development', function () use($app) {
$app->config(array('log.enable' => true));
});
$this->assertTrue($app->getLog()->getLogger() instanceof CustomLogger);
}
示例2: testGetLog
/**
* Test get log
*
* This asserts that a Slim app has a default Log
* upon instantiation. The Log itself is tested
* separately in another file.
*/
public function testGetLog()
{
$s = new Slim();
$this->assertInstanceOf('Slim_Log', $s->getLog());
}
示例3: Slim
<?php
require 'Slim/Slim.php';
require 'Slim/db.php';
/***********DB Connection start************/
include 'db_config.php';
/***********DB Connection End************/
/************Modules Include here**************/
include 'Slim/modules/user_manager.php';
include 'Slim/modules/customer_manager.php';
/************Modules End**************/
//$app = new Slim();
$app = new Slim(array('log.enable' => true));
/***************Error Handling*************/
$app->get('/', function () use($app) {
$log = $app->getLog();
$log->debug('root');
});
/***************Error Handling*************/
/************Create routes ************/
include 'routes.php';
/************End routes ************/
$app->run();